Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-04-06 14:14:47 +0300
committerJacques Lucke <jacques@blender.org>2020-04-06 14:23:20 +0300
commit7dfdb1a8a0cb21b80e50e227b5b12e4c9bfdf78d (patch)
treea91655b21acec9ae301d48e445fcccefde75312f /source/blender/blenkernel/intern/appdir.c
parent2b1e84c0de47e9771ef0e4d51ced2123bc195864 (diff)
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
Diffstat (limited to 'source/blender/blenkernel/intern/appdir.c')
0 files changed, 0 insertions, 0 deletions