Created by: zeffii
backend cleanup of features.
- introduces
sv_execute(self, context, node)
to Operators that use mixinSvGenericNodeLocator
- if you still want to write the full
def execute(self, context)
you can, i've left some of the more elaborateexecute
implementations unchanged. - in
sv_execute
you can always return early. Usingreturn
will always result inreturn {"FINISHED"}
,- you can
return {"CANCELLED"}
explicitely if you want. (or any other of the accepted Set values
- you can
a typical SvGenericNodeLocator operator would change from
...
def execute(self, context):
"""
passes the operator's 'self' too to allow calling self.report()
"""
node = self.get_node(context)
if node:
node.get_objects_from_scene(self)
return {'FINISHED'}
return {'CANCELLED'}
to this
def sv_execute(self, context, node):
"""
passes the operator's 'self' too to allow calling self.report()
"""
node.get_objects_from_scene(self)
as you can see, the node locating is entirely taken care of.