Blender Git Loki
Page: 2 / 3
April 6, 2020, 13:20 (GMT) |
handle node tree in lib_query.c |
April 6, 2020, 11:52 (GMT) |
Add emitters, events, forces and control flow socket types This is part of T73324. The shapes and colors of the sockets will most likely change later on. This script can be used to create a node with the new socket types: ``` import bpy class MyCustomNode(bpy.types.Node): bl_idname = 'CustomNodeType' bl_label = "Custom Node" def init(self, context): self.inputs.new('NodeSocketEmitters', "Emitters") self.inputs.new('NodeSocketEvents', "Events") self.inputs.new('NodeSocketForces', "Forces") self.inputs.new('NodeSocketControlFlow', "Control Flow") self.outputs.new('NodeSocketEmitters', "Emitters") self.outputs.new('NodeSocketEvents', "Events") self.outputs.new('NodeSocketForces', "Forces") self.outputs.new('NodeSocketControlFlow', "Control Flow") bpy.utils.register_class(MyCustomNode) if len(bpy.data.simulations) == 0: bpy.data.simulations.new("Simulation") sim = bpy.data.simulations[0] sim.node_tree.nodes.new("CustomNodeType") ``` Differential Revision: https://developer.blender.org/D7349 |
April 6, 2020, 11:23 (GMT) |
New Object and Image socket types The main difficulty with adding these types is that they are the first sockets types that reference ID data in their `default_value`. That means that I had to add some new logic in a few places to deal with reference counting. I hope I found all the places... It seems to work fine in my tests. For now these socket types can only be created using a script like the one below: ``` import bpy class MyCustomNode(bpy.types.Node): bl_idname = 'CustomNodeType' bl_label = "Custom Node" def init(self, context): self.inputs.new('NodeSocketObject', "Object") self.inputs.new('NodeSocketImage', "Image") bpy.utils.register_class(MyCustomNode) if len(bpy.data.simulations) == 0: bpy.data.simulations.new("Simulation") sim = bpy.data.simulations[0] sim.node_tree.nodes.new("CustomNodeType") ``` After running the script, go to the simulation editor and select the newly created simulation. --- We might want to change `readfile.c` so that linked objects/images are only loaded, when the socket is not connected. Otherwise it can be tricky to figure out why certain id data blocks are still referenced by the node tree later on. Differential Revision: https://developer.blender.org/D7347 |
April 6, 2020, 10:04 (GMT) |
Merge branch 'simulation-tree-arc' into embedded_simulation_node_tree |
April 6, 2020, 10:01 (GMT) |
fix after merge |
April 6, 2020, 09:55 (GMT) |
Merge branch 'simulation-data-block' into simulation-tree-arc |
April 6, 2020, 09:51 (GMT) |
Merge branch 'master' into simulation-data-block |
April 1, 2020, 10:17 (GMT) |
Embed simulation node tree in simulation data block This also shows the node tree in the Simulation Editor. There is a new operator to add a simulation. One debatable aspect of this patch is how I integrated the `SpaceNodeEditor.simulation` property in RNA. I decided to wrap the existing `id` property, because the description says `Data-block whose nodes are being edited`, which is exactly what is happening here. Differential Revision: https://developer.blender.org/D7301 |
April 1, 2020, 09:44 (GMT) |
better handling when id has wrong type |
April 1, 2020, 09:34 (GMT) |
better support for building without simulation type |
April 1, 2020, 09:31 (GMT) |
show some builtin nodes in menu |
April 1, 2020, 09:27 (GMT) |
support adding new simulation from header |
April 1, 2020, 09:16 (GMT) |
cleanup simulation property of space |
April 1, 2020, 08:56 (GMT) |
Merge branch 'simulation-tree-arc' into embedded_simulation_node_tree |
April 1, 2020, 08:52 (GMT) |
add license headers |
March 31, 2020, 12:05 (GMT) |
initial node tree embedding and simulation editor |
March 31, 2020, 10:27 (GMT) |
Add simulation node tree type This implements a new builtin node tree type called `SimulationNodeTree`. It is not yet embedded in the `Simulation` data block. This is part of T73324. The `WITH_NEW_SIMULATION_TYPE` cmake option is used to control whether `Simulation Editor` is shown in the editors menu. Disabling the rna code with this option was a bit tricky, because the node tree type stores a reference to the rna type. I could do the `#ifdef WITH_NEW_SIMULATION_TYPE` everywhere, but I'm not sure if it is worth the effort. Currently there is only the group node, which is unusable, because there are no other nodes. I'll submit those for review separately. Differential Revision: https://developer.blender.org/D7287 |
March 31, 2020, 07:40 (GMT) |
Merge branch 'master' into simulation-data-block |
March 24, 2020, 15:30 (GMT) |
Replace VO_DS_EXPAND with SIM_DS_EXPAND |
March 24, 2020, 15:29 (GMT) |
remove unnecessary case in lib_remap.c |