new node input single vertex#90
Conversation
aachman98
left a comment
There was a problem hiding this comment.
Great! I actually already had reviewed this file when you sent it on email. Added a couple of optional changes just for the sake of uniformity though. Change it if you want, and let me know so that I can merge this to master.
| bl_idname = "ScSingleVertex" | ||
| bl_label = "Single Vertex" | ||
|
|
||
| def init(self, context): |
| def init(self, context): | ||
| super().init(context) | ||
|
|
||
| def error_condition(self): |
| name = self.inputs["Name"].default_value | ||
| me = bpy.data.meshes.new(name + "_mesh") | ||
| obj = bpy.data.objects.new(name, me) | ||
| obj.location = bpy.context.scene.cursor.location |
There was a problem hiding this comment.
Leave the object at 0,0,0 instead of cursor location
Can be later changed using "Set Transform" if required
There was a problem hiding this comment.
Leave the object at 0,0,0 instead of cursor location
Can be later changed using "Set Transform" if required
I could check that when creating any object with the sorcar nodes, the behavior is that it is created where you have the cursor. To have a greater consistent with the other nodes, I thought it was a good idea to make it behave like the other nodes.
There was a problem hiding this comment.
Oh right, I forgot that primitives are added on the cursor...
|
What about the other implementation: Adding a plane & merging at center? |
It was a quick initial implementation. Keep in mind that creating a plane (two triangles) and then collapsing them to obtain a single vertex, are more steps and is more expensive than creating the vertex directly. In a simple scene it can be the same if you use one or the other, but in very heavy scenes you will be grateful to optimize the computation avoiding unnecessary intermediate processes. |
I created the node to create a single vertex :)