add back create vertex group node
This commit is contained in:
+17
-18
@@ -91,25 +91,24 @@ class EditOps(ObjectOps):
|
||||
|
||||
|
||||
def map_args(bpy, func):
|
||||
print(func, type(func))
|
||||
# print(func, type(func))
|
||||
|
||||
if str(type(func)) == "<class 'bpy_func'>":
|
||||
func = func.__init__
|
||||
print(func)
|
||||
print(dir(func))
|
||||
# bpy.context.object.vertex_groups.new
|
||||
# if str(type(func)) == "<class 'bpy_func'>":
|
||||
# func = func.__init__
|
||||
# print(func)
|
||||
# print(dir(func))
|
||||
|
||||
if callable(func):
|
||||
sig = inspect.signature(func)
|
||||
print(sig)
|
||||
args_dict = {
|
||||
name: param.default
|
||||
for name, param in sig.parameters.items()
|
||||
if param.default is not inspect.Parameter.empty
|
||||
}
|
||||
print(args_dict)
|
||||
return args_dict
|
||||
|
||||
|
||||
# if callable(func):
|
||||
# sig = inspect.signature(func)
|
||||
# print(sig)
|
||||
# args_dict = {
|
||||
# name: param.default
|
||||
# for name, param in sig.parameters.items()
|
||||
# if param.default is not inspect.Parameter.empty
|
||||
# }
|
||||
# print(args_dict)
|
||||
# return args_dict
|
||||
|
||||
# if isinstance(func, bpy.types.Function):
|
||||
# print('is class')
|
||||
@@ -179,7 +178,7 @@ def print_blender_functions(path):
|
||||
def create_ops_class(cls, path, name=None):
|
||||
node_name = snake_to_camel(
|
||||
name if name is not None else path.split('.')[-1])
|
||||
print(node_name)
|
||||
# print(node_name)
|
||||
return type(
|
||||
node_name, (cls, object),
|
||||
{
|
||||
|
||||
@@ -52,5 +52,5 @@ NODE_CLASS_MAPPINGS = {
|
||||
}
|
||||
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"CreateVertexGroup": "Vertex Group"
|
||||
"CreateVertexGroup": "Vertex Group (Old)"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import blender_node
|
||||
|
||||
|
||||
class CreateVertexGroup(blender_node.EditOps):
|
||||
EXTRA_INPUT_TYPES = {
|
||||
"name": ("STRING", {
|
||||
"multiline": False,
|
||||
"default": "Group"
|
||||
}),
|
||||
}
|
||||
|
||||
def blender_process(self, bpy, BPY_OBJ, name, **props):
|
||||
bpy.context.object.vertex_groups.new(name=name)
|
||||
Reference in New Issue
Block a user