Skip to content

Commit 55f4190

Browse files
committed
feat: new geo node tree flags
1 parent 521be11 commit 55f4190

File tree

2 files changed

+39
-70
lines changed

2 files changed

+39
-70
lines changed

geometry/node_settings.py

Lines changed: 28 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@
4343
'NodeGroupInput' : [],
4444

4545
# Input > Scene
46+
'GeometryNodeTool3DCursor' : [],
47+
4648
'GeometryNodeCollectionInfo' : [("transform_space", ST.ENUM)],
4749

4850
'GeometryNodeImageInfo' : [],
49-
5051
'GeometryNodeIsViewport' : [],
5152

5253
'GeometryNodeObjectInfo' : [("transform_space", ST.ENUM)],
5354

5455
'GeometryNodeSelfObject' : [],
55-
5656
'GeometryNodeInputSceneTime' : [],
5757

5858

@@ -64,21 +64,18 @@
6464

6565
# GEOMETRY
6666
'GeometryNodeJoinGeometry' : [],
67-
6867
'GeometryNodeGeometryToInstance' : [],
6968

7069
# Geometry > Read
7170
'GeometryNodeInputID' : [],
72-
7371
'GeometryNodeInputIndex' : [],
7472

7573
'GeometryNodeInputNamedAttribute' : [("data_type", ST.ENUM)],
7674

7775
'GeometryNodeInputNormal' : [],
78-
7976
'GeometryNodeInputPosition' : [],
80-
8177
'GeometryNodeInputRadius' : [],
78+
'GeometryNodeToolSelection' : [],
8279

8380
# Geometry > Sample
8481
'GeometryNodeProximity' : [("target_element", ST.ENUM)],
@@ -95,13 +92,12 @@
9592
'GeometryNodeSampleNearest' : [("domain", ST.ENUM)],
9693

9794
# Geometry > Write
98-
'GeometryNodeSetID' : [],
99-
100-
'GeometryNodeSetPosition' : [],
95+
'GeometryNodeSetID' : [],
96+
'GeometryNodeSetPosition' : [],
97+
'GeometryNodeToolSetSelection' : [],
10198

10299
# Geometry > Operations
103100
'GeometryNodeBoundBox' : [],
104-
105101
'GeometryNodeConvexHull' : [],
106102

107103
'GeometryNodeDeleteGeometry' : [("domain", ST.ENUM),
@@ -112,7 +108,6 @@
112108
'GeometryNodeMergeByDistance' : [("mode", ST.ENUM)],
113109

114110
'GeometryNodeTransform' : [],
115-
116111
'GeometryNodeSeparateComponents' : [],
117112

118113
'GeometryNodeSeparateGeometry' : [("domain", ST.ENUM)],
@@ -121,24 +116,17 @@
121116
# CURVE
122117
# Curve > Read
123118
'GeometryNodeInputCurveHandlePositions' : [],
124-
125119
'GeometryNodeCurveLength' : [],
126-
127120
'GeometryNodeInputTangent' : [],
128-
129121
'GeometryNodeInputCurveTilt' : [],
130-
131122
'GeometryNodeCurveEndpointSelection' : [],
132123

133124
'GeometryNodeCurveHandleTypeSelection' : [("handle_type", ST.ENUM),
134125
("mode", ST.ENUM_SET)],
135126

136127
'GeometryNodeInputSplineCyclic' : [],
137-
138128
'GeometryNodeSplineLength' : [],
139-
140129
'GeometryNodeSplineParameter' : [],
141-
142130
'GeometryNodeInputSplineResolution' : [],
143131

144132
# Curve > Sample
@@ -150,7 +138,6 @@
150138
'GeometryNodeSetCurveNormal' : [("mode", ST.ENUM)],
151139

152140
'GeometryNodeSetCurveRadius' : [],
153-
154141
'GeometryNodeSetCurveTilt' : [],
155142

156143
'GeometryNodeSetCurveHandlePositions' : [("mode", ST.ENUM)],
@@ -159,7 +146,6 @@
159146
("mode", ST.ENUM_SET)],
160147

161148
'GeometryNodeSetSplineCyclic' : [],
162-
163149
'GeometryNodeSetSplineResolution' : [],
164150

165151
'GeometryNodeCurveSplineType' : [("spline_type", ST.ENUM)],
@@ -180,7 +166,6 @@
180166
'GeometryNodeResampleCurve' : [("mode", ST.ENUM)],
181167

182168
'GeometryNodeReverseCurve' : [],
183-
184169
'GeometryNodeSubdivideCurve' : [],
185170

186171
'GeometryNodeTrimCurve' : [("mode", ST.ENUM)],
@@ -195,7 +180,6 @@
195180
'GeometryNodeCurvePrimitiveLine' : [("mode", ST.ENUM)],
196181

197182
'GeometryNodeCurveSpiral' : [],
198-
199183
'GeometryNodeCurveQuadraticBezier' : [],
200184

201185
'GeometryNodeCurvePrimitiveQuadrilateral' : [("mode", ST.ENUM)],
@@ -204,54 +188,38 @@
204188

205189
# Curve > Topology
206190
'GeometryNodeOffsetPointInCurve' : [],
207-
208191
'GeometryNodeCurveOfPoint' : [],
209-
210192
'GeometryNodePointsOfCurve' : [],
211193

212194

213195
# INSTANCES
214196
'GeometryNodeInstanceOnPoints' : [],
215-
216197
'GeometryNodeInstancesToPoints' : [],
217198

218199
'GeometryNodeRealizeInstances' : [("legacy_behavior", ST.BOOL)],
219200

220201
'GeometryNodeRotateInstances' : [],
221-
222202
'GeometryNodeScaleInstances' : [],
223-
224203
'GeometryNodeTranslateInstances' : [],
225-
226204
'GeometryNodeInputInstanceRotation' : [],
227-
228205
'GeometryNodeInputInstanceScale' : [],
229206

230207

231208
# MESH
232209
# Mesh > Read
233210
'GeometryNodeInputMeshEdgeAngle' : [],
234-
235211
'GeometryNodeInputMeshEdgeNeighbors' : [],
236-
237212
'GeometryNodeInputMeshEdgeVertices' : [],
238-
239213
'GeometryNodeEdgesToFaceGroups' : [],
240-
241214
'GeometryNodeInputMeshFaceArea' : [],
242-
243215
'GeometryNodeInputMeshFaceNeighbors' : [],
244-
216+
'GeometryNodeToolFaceSet' : [],
245217
'GeometryNodeMeshFaceSetBoundaries' : [],
246-
247218
'GeometryNodeInputMeshFaceIsPlanar' : [],
248-
249219
'GeometryNodeInputShadeSmooth' : [],
250-
220+
'GeometryNodeInputEdgeSmooth' : [],
251221
'GeometryNodeInputMeshIsland' : [],
252-
253222
'GeometryNodeInputShortestEdgePaths' : [],
254-
255223
'GeometryNodeInputMeshVertexNeighbors' : [],
256224

257225
# Mesh > Sample
@@ -260,13 +228,12 @@
260228
'GeometryNodeSampleUVSurface' : [("data_type", ST.ENUM)],
261229

262230
# Mesh > Write
231+
'GeometryNodeToolSetFaceSet' : [],
263232
'GeometryNodeSetShadeSmooth' : [],
264233

265234
# Mesh > Operations
266235
'GeometryNodeDualMesh' : [],
267-
268236
'GeometryNodeEdgePathsToCurves' : [],
269-
270237
'GeometryNodeEdgePathsToSelection' : [],
271238

272239
'GeometryNodeExtrudeMesh' : [("mode", ST.ENUM)],
@@ -285,7 +252,6 @@
285252
("scale_mode", ST.ENUM)],
286253

287254
'GeometryNodeSplitEdges' : [],
288-
289255
'GeometryNodeSubdivideMesh' : [],
290256

291257
'GeometryNodeSubdivisionSurface' : [("boundary_smooth", ST.ENUM),
@@ -302,7 +268,6 @@
302268
'GeometryNodeMeshCylinder' : [("fill_type", ST.ENUM)],
303269

304270
'GeometryNodeMeshGrid' : [],
305-
306271
'GeometryNodeMeshIcoSphere' : [],
307272

308273
'GeometryNodeMeshCircle' : [("fill_type", ST.ENUM)],
@@ -314,17 +279,11 @@
314279

315280
# Mesh > Topology
316281
'GeometryNodeCornersOfFace' : [],
317-
318282
'GeometryNodeCornersOfVertex' : [],
319-
320283
'GeometryNodeEdgesOfCorner' : [],
321-
322284
'GeometryNodeEdgesOfVertex' : [],
323-
324285
'GeometryNodeFaceOfCorner' : [],
325-
326286
'GeometryNodeOffsetCornerInFace' : [],
327-
328287
'GeometryNodeVertexOfCorner' : [],
329288

330289
# Mesh > UV
@@ -340,7 +299,7 @@
340299
("use_legacy_normal", ST.BOOL)],
341300

342301
'GeometryNodePoints' : [],
343-
302+
'GeometryNodePointsToCurves' : [],
344303
'GeometryNodePointsToVertices' : [],
345304

346305
'GeometryNodePointsToVolume' : [("resolution_mode", ST.ENUM)],
@@ -350,25 +309,19 @@
350309

351310
# VOLUME
352311
'GeometryNodeVolumeCube' : [],
353-
354312
'GeometryNodeVolumeToMesh' : [("resolution_mode", ST.ENUM)],
355313

356314

357315
# SIMULATION
358316
'GeometryNodeSimulationInput' : [],
359-
360317
'GeometryNodeSimulationOutput' : [],
361318

362319

363320
# MATERIAL
364321
'GeometryNodeReplaceMaterial' : [],
365-
366322
'GeometryNodeInputMaterialIndex' : [],
367-
368323
'GeometryNodeMaterialSelection' : [],
369-
370324
'GeometryNodeSetMaterial' : [],
371-
372325
'GeometryNodeSetMaterialIndex' : [],
373326

374327

@@ -413,7 +366,10 @@
413366

414367
'FunctionNodeRandomValue' : [("data_type", ST.ENUM)],
415368

416-
'GeometryNodeSwitch' : [("input_type", ST.ENUM)],
369+
'GeometryNodeRepeatInput' : [],
370+
'GeometryNodeRepeatOutput' : [],
371+
372+
'GeometryNodeSwitch' : [("input_type", ST.ENUM)],
417373

418374
# Utilities > Color
419375
'ShaderNodeValToRGB' : [("color_ramp", ST.COLOR_RAMP)],
@@ -430,11 +386,8 @@
430386

431387
# Utilities > Text
432388
'GeometryNodeStringJoin' : [],
433-
434389
'FunctionNodeReplaceString' : [],
435-
436390
'FunctionNodeSliceString' : [],
437-
438391
'FunctionNodeStringLength' : [],
439392

440393
'GeometryNodeStringToCurves' : [("align_x", ST.ENUM),
@@ -444,7 +397,6 @@
444397
("pivot_mode", ST.ENUM)],
445398

446399
'FunctionNodeValueToString' : [],
447-
448400
'FunctionNodeInputSpecialCharacters' : [],
449401

450402
# Utilities > Vector
@@ -456,7 +408,6 @@
456408
("rotation_type", ST.ENUM)],
457409

458410
'ShaderNodeCombineXYZ' : [],
459-
460411
'ShaderNodeSeparateXYZ' : [],
461412

462413
# Utilities > Field
@@ -490,11 +441,21 @@
490441
("use_clamp", ST.BOOL)],
491442

492443
# Utilities > Rotation
493-
'FunctionNodeAlignEulerToVector' : [("axis", ST.ENUM),
494-
("pivot_axis", ST.ENUM)],
444+
'FunctionNodeAlignEulerToVector' : [("axis", ST.ENUM),
445+
("pivot_axis", ST.ENUM)],
446+
447+
'FunctionNodeAxisAngleToRotation' : [],
448+
'FunctionNodeEulerToRotation' : [],
449+
'FunctionNodeInvertRotation' : [],
495450

496-
'FunctionNodeRotateEuler' : [("space", ST.ENUM),
497-
("type", ST.ENUM)],
451+
'FunctionNodeRotateEuler' : [("space", ST.ENUM),
452+
("type", ST.ENUM)],
453+
454+
'FunctionNodeRotateVector' : [],
455+
'FunctionNodeRotationToAxisAngle' : [],
456+
'FunctionNodeRotationToEuler' : [],
457+
'FunctionNodeRotationToQuaternion' : [],
458+
'FunctionNodeQuaternionToRotation' : [],
498459

499460
# MISC
500461
'NodeFrame' : [],

geometry/operator.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,17 @@ def _process_node_tree(self, node_tree: GeometryNodeTree,
119119
self._write("\n")
120120

121121
if bpy.app.version >= (4, 0, 0):
122-
self._write(f"{inner}{nt_var}.is_modifier = {node_tree.is_modifier}\n")
123-
self._write(f"{inner}{nt_var}.is_tool = {node_tree.is_tool}\n")
124-
122+
geo_node_tree_flags = ["is_mode_edit",
123+
"is_mode_sculpt",
124+
"is_modifier",
125+
"is_tool",
126+
"is_type_curve",
127+
"is_type_mesh",
128+
"is_type_point_cloud"]
129+
for flag in geo_node_tree_flags:
130+
self._write(f"{inner}{nt_var}.{flag} = {getattr(node_tree, flag)}\n")
131+
self._write("\n")
132+
125133
#initialize nodes
126134
self._write(f"{inner}#initialize {nt_var} nodes\n")
127135

0 commit comments

Comments
 (0)