fixed api_WIP, minor cleanup in other nodes

This commit is contained in:
martinaCodes
2022-09-04 23:36:30 +02:00
parent 8b8024ba7e
commit 7c2162f054
7 changed files with 73 additions and 87 deletions
+1 -15
View File
@@ -59,22 +59,8 @@ class SvIfcCreateShape(bpy.types.Node, SverchCustomTreeNode, ifcsverchok.helper.
def process(self):
self.sv_input_names = ["file", "entity"]
super().process()
def process_helper(self):
print("Hello from helper")
sv_inputs_nested = []
for name in self.sv_input_names:
sv_inputs_nested.append(self.inputs[name].sv_get())
print(24*"#","\n", "sv_input: ", self.inputs[name].sv_get(), "input type: ", type(self.inputs[name].sv_get()), "\n", "#"*24)
for sv_input_nested in zip_long_repeat(*sv_inputs_nested):
for sv_input in zip_long_repeat(*sv_input_nested):
sv_input = list(sv_input)
print(24*"#","\n", "sv_input post zip_long_repeat: ", sv_input, "input type: ", type(sv_input), "\n", "#"*24)
self.process_ifc(*sv_input)
def process_ifc(self, file, entity):
print("process ifc...")
print("entity: ", entity)
try:
if not entity.is_a("IfcProduct"):
return
@@ -88,7 +74,7 @@ class SvIfcCreateShape(bpy.types.Node, SverchCustomTreeNode, ifcsverchok.helper.
obj = bpy.data.objects.new("IFC Element", mesh)
bpy.context.scene.collection.objects.link(obj)
except:
print("Entity could not be converted into a shape", entity)
raise Exception("Entity could not be converted into a shape. Entity: {}".format(entity))
def register():