Versioning function to replace legacy instancing panel by geometry node modifier #105494

Open
Iliya Katushenock wants to merge 44 commits from mod_moder/blender:instances into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
7 changed files with 1139 additions and 2 deletions

View File

@ -247,7 +247,7 @@ void IDP_ClearProperty(struct IDProperty *prop);
void IDP_Reset(struct IDProperty *prop, const struct IDProperty *reference);
#define IDP_Int(prop) ((prop)->data.val)
#define IDP_Bool(prop) ((prop)->data.val)
#define IDP_Bool(prop) (*(bool *)&(prop)->data.val)
#define IDP_Array(prop) ((prop)->data.pointer)
/* C11 const correctness for casts */
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)

View File

@ -114,6 +114,11 @@ template<typename Key, typename Value> class MultiValueMap {
return {};
}
bool is_empty() const
{
return map_.is_empty();
}
/**
* Get the number of keys.
*/

View File

@ -15,6 +15,7 @@ set(INC
../makesdna
../makesrna
../nodes
../modifiers
../render
../sequencer
../windowmanager

View File

@ -29,7 +29,9 @@
void do_versions_after_linking_400(FileData * /*fd*/, Main *bmain)
{
UNUSED_VARS(bmain);
if (!MAIN_VERSION_ATLEAST(bmain, 400, 3)) {
Review

Creating IDs in versioning code is forbidden. Until a better system (more generic) is implemented, a specific call needs to be added after all versioning is done, see e.g. the call to BKE_lib_override_library_main_proxy_convert in setup_app_data()

Creating IDs in versioning code is forbidden. Until a better system (more generic) is implemented, a specific call needs to be added after all versioning is done, see e.g. the call to `BKE_lib_override_library_main_proxy_convert` in `setup_app_data()`
remove_legacy_instances_on(bmain, bmain->objects);
}
}
static void version_mesh_legacy_to_struct_of_array_format(Mesh &mesh)

File diff suppressed because it is too large Load Diff

View File

@ -123,4 +123,7 @@ void node_tree_relink_with_socket_id_map(bNodeTree &ntree,
bNode &old_node,
bNode &new_node,
const blender::Map<std::string, std::string> &map);
void remove_legacy_instances_on(Main *bmain, ListBase &lb_objects);
#endif

View File

@ -27,6 +27,7 @@ static void node_declare(const bNodeTree &node_tree,
return;
}
BLI_assert(group->runtime->field_inferencing_interface != nullptr);
const FieldInferencingInterface &field_interface = *group->runtime->field_inferencing_interface;
for (const int i : r_declaration.inputs.index_range()) {
r_declaration.inputs[i]->input_field_type = field_interface.inputs[i];