Blender Git Loki

Git Commits -> Revision 429afe0

Revision 429afe0 by Kévin Dietrich (master)
August 30, 2020, 21:49 (GMT)
Cycles: introduce an ownership system to protect nodes from unwanted deletions.

Problem: the Blender synchronization process creates and tags nodes for usage. It does
this by directly adding and removing nodes from the scene data. If some node is not tagged
as used at the end of a synchronization, it then deletes the node from the scene. This poses
a problem when it comes to supporting procedural nodes who can create other nodes not known
by the Blender synchonization system, which will remove them.

Nodes now have a NodeOwner, which is set after creation. Those owners for now are the Scene
for scene level nodes and ShaderGraph for shader nodes. Instead of creating and deleting
nodes using `new` and `delete` explicitely, we now use `create_node` and `delete_node` methods
found on the owners. `delete_node`�will assert that the owner is the right one.

Whenever a scene level node is created or deleted, the appropriate node manager is tagged for
an update, freeing this responsability from BlenderSync or other software exporters.

Concerning BlenderSync, the `id_maps` do not explicitely manipulate scene data anymore, they
only keep track of which nodes are used, employing the scene to create and delete them. To
achieve this, the ParticleSystem is now a Node, although it does not have any sockets.

This is part of T79131.

Reviewed By: #cycles, brecht

Maniphest Tasks: T79131

Differential Revision: https://developer.blender.org/D8540

Commit Details:

Full Hash: 429afe0c626a6d608385c6bc3a348b3ac8cfa8c0
Parent Commit: 1936388
Lines Changed: +461, -232

20 Modified Paths:

/intern/cycles/blender/blender_geometry.cpp (+3, -3) (Diff)
/intern/cycles/blender/blender_id_map.h (+16, -33) (Diff)
/intern/cycles/blender/blender_light.cpp (+3, -3) (Diff)
/intern/cycles/blender/blender_object.cpp (+5, -9) (Diff)
/intern/cycles/blender/blender_particles.cpp (+2, -1) (Diff)
/intern/cycles/blender/blender_shader.cpp (+103, -102) (Diff)
/intern/cycles/blender/blender_sync.cpp (+6, -6) (Diff)
/intern/cycles/graph/node.cpp (+16, -0) (Diff)
/intern/cycles/graph/node.h (+10, -0) (Diff)
/intern/cycles/render/graph.cpp (+16, -16) (Diff)
/intern/cycles/render/graph.h (+24, -6) (Diff)
/intern/cycles/render/nodes.cpp (+26, -23) (Diff)
/intern/cycles/render/nodes.h (+6, -6) (Diff)
/intern/cycles/render/osl.cpp (+3, -2) (Diff)
/intern/cycles/render/osl.h (+2, -1) (Diff)
/intern/cycles/render/particles.cpp (+7, -1) (Diff)
/intern/cycles/render/particles.h (+5, -1) (Diff)
/intern/cycles/render/scene.cpp (+129, -5) (Diff)
/intern/cycles/render/scene.h (+71, -1) (Diff)
/intern/cycles/render/shader.cpp (+8, -13) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021