def dispatch(self, context, type_op):
        n = context.node
        objs = get_children(n, kind='CURVE')

        # find a simpler way to do this :)
        if type_op in {'hide', 'hide_render', 'hide_select', 'select'}:
            for obj in objs:
                setattr(obj, type_op, getattr(n, type_op))
            setattr(n, type_op, not getattr(n, type_op))

        elif type_op == 'random_mesh_name':
            n.basemesh_name = get_random_init()

        elif type_op == 'add_material':
            mat = bpy.data.materials.new('sv_material')
            mat.use_nodes = True
            n.material = mat.name
            print(mat.name)
Esempio n. 2
0
    def dispatch(self, context, type_op):
        n = context.node
        objs = get_children(n, kind='CURVE')

        # find a simpler way to do this :)
        if type_op in {'hide', 'hide_render', 'hide_select', 'select'}:
            for obj in objs:
                setattr(obj, type_op, getattr(n, type_op))
            setattr(n, type_op, not getattr(n, type_op))

        elif type_op == 'random_mesh_name':
            n.basemesh_name = get_random_init()

        elif type_op == 'add_material':
            mat = bpy.data.materials.new('sv_material')
            mat.use_nodes = True
            n.material = mat.name
            print(mat.name)
 def set_corresponding_materials(self):
     if bpy.data.materials.get(self.material):
         for obj in get_children(self, kind='CURVE'):
             obj.active_material = bpy.data.materials[self.material]
Esempio n. 4
0
 def set_corresponding_materials(self):
     if bpy.data.materials.get(self.material):
         for obj in get_children(self, kind='CURVE'):
             obj.active_material = bpy.data.materials[self.material]