gn assignment
This commit is contained in:
parent
36e11cdd49
commit
b736f1821a
1 changed files with 15 additions and 0 deletions
15
__init__.py
15
__init__.py
|
|
@ -780,6 +780,21 @@ class SLICENODE_GcodeToMesh(ExecSliceNode):
|
||||||
mesh.from_pydata(vertices, edges, [])
|
mesh.from_pydata(vertices, edges, [])
|
||||||
mesh.update()
|
mesh.update()
|
||||||
|
|
||||||
|
# Assign Geometry Nodes nodegroup for preview
|
||||||
|
ng_name = "Nonplanar Slicing Preview"
|
||||||
|
if ng_name in bpy.data.node_groups:
|
||||||
|
ng = bpy.data.node_groups[ng_name]
|
||||||
|
# Check if already assigned
|
||||||
|
has_preview = False
|
||||||
|
for mod in obj.modifiers:
|
||||||
|
if mod.type == 'NODES' and mod.node_group == ng: # type: ignore
|
||||||
|
has_preview = True
|
||||||
|
break
|
||||||
|
|
||||||
|
if not has_preview:
|
||||||
|
mod = obj.modifiers.new(name="Preview", type='NODES') # type: ignore
|
||||||
|
mod.node_group = ng
|
||||||
|
|
||||||
return 'ok'
|
return 'ok'
|
||||||
|
|
||||||
@register_class
|
@register_class
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue