+ size_t compute_chain_number_for_block(size_t block_idx, const std::bitset<256> &disabled) const;
+ static void find_inputs_for_block(lua_State *L, Scene *scene, Block *block);
+
+ // Find out which blocks (indexed by position in the “blocks” array),
+ // if any, are disabled in a given instantiation. A disabled block is
+ // one that will not be instantiated at all, because it is a secondary
+ // (ie., not the first) input of some multi-input effect that was replaced
+ // with IdentityEffect in the given instantiation.
+ //
+ // Set chain_idx to size_t(-1) to use whatever is in each block's
+ // currently_chosen_alternative.
+ std::bitset<256> find_disabled_blocks(size_t chain_idx) const;
+ void find_disabled_blocks(size_t chain_idx, size_t block_idx, bool currently_disabled, std::bitset<256> *disabled) const;
+
+ // If a block is disabled, it should always have canonical_alternative chosen,
+ // so that we don't instantiate a bunch of irrelevant duplicates that
+ // differ only in disabled blocks. You can check this property with
+ // is_noncanonical_chain() and then avoid instantiating the ones where
+ // it returns true.
+ bool is_noncanonical_chain(size_t chain_idx) const;