@ -181,20 +181,24 @@ class PlasmaModifierProperties(bpy.types.PropertyGroup):
class PlasmaModifierLogicWiz :
class PlasmaModifierLogicWiz :
def convert_logic ( self , bo , * * kwargs ) :
def convert_logic ( self , bo , * * kwargs ) :
""" Creates, converts, and returns an unmanaged NodeTree for this logic wizard. If the wizard
""" Attempts to look up an already existing logic tree matching the name provided and returns
fails during conversion , the temporary tree is deleted for you . However , on success , you
it , if found . If not , creates , converts , and returns an unmanaged NodeTree for this wizard .
are responsible for removing the tree from Blender , if applicable . """
If the wizard fails during conversion , the temporary tree is deleted for you . However , on
success , you are responsible for removing the tree from Blender , if applicable . """
name = kwargs . pop ( " name " , self . key_name )
name = kwargs . pop ( " name " , self . key_name )
assert not " tree " in kwargs
assert not " tree " in kwargs
tree = bpy . data . node_groups . new ( name , " PlasmaNodeTree " )
kwargs [ " tree " ] = tree
node_groups = bpy . data . node_groups
try :
tree = node_groups . get ( name )
self . logicwiz ( bo , * * kwargs )
if tree is None :
except :
tree = node_groups . new ( name , " PlasmaNodeTree " )
bpy . data . node_groups . remove ( tree )
kwargs [ " tree " ] = tree
raise
try :
else :
self . logicwiz ( bo , * * kwargs )
return tree
except :
bpy . data . node_groups . remove ( tree )
raise
return tree
def _create_python_file_node ( self , tree , filename : str , attributes : Dict [ str , Any ] ) - > bpy . types . Node :
def _create_python_file_node ( self , tree , filename : str , attributes : Dict [ str , Any ] ) - > bpy . types . Node :
pfm_node = tree . nodes . new ( " PlasmaPythonFileNode " )
pfm_node = tree . nodes . new ( " PlasmaPythonFileNode " )