def init(self, context): """ this function is triggered upon node creation, - freezes the node - delegates further initialization information to sv_init - sets node color - unfreezes the node - sets custom defaults (nodes, and sockets) """ ng = self.id_data ng.freeze() if hasattr(self, "sv_init"): try: ng.configuring_new_node = True self.sv_init(context) except Exception as err: print( 'nodetree.node.sv_init failure - stare at the error message below' ) sys.stderr.write('ERROR: %s\n' % str(err)) ng.configuring_new_node = False self.set_color() ng.unfreeze() if not ng.limited_init: # print('applying default for', self.name) set_defaults_if_defined(self)
def init(self, context): """ this function is triggered upon node creation, - freezes the node - delegates further initialization information to sv_init - sets node color - unfreezes the node - sets custom defaults (nodes, and sockets) """ ng = self.id_data ng.freeze() if hasattr(self, "sv_init"): self.sv_init(context) self.set_color() ng.unfreeze() if not ng.limited_init: # print('applying default for', self.name) set_defaults_if_defined(self)
def init(self, context): """ this function is triggered upon node creation, - freezes the node - delegates further initialization information to sv_init - sets node color - unfreezes the node - sets custom defaults (nodes, and sockets) """ ng = self.id_data ng.freeze() if hasattr(self, "sv_init"): self.sv_init(context) self.set_color() ng.unfreeze() if not ng.limited_init: # print('applying default for', self.name) set_defaults_if_defined(self)