-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new node input single vertex #90
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
nodes/inputs/ScSingleVertex.py
Outdated
bl_idname = "ScSingleVertex" | ||
bl_label = "Single Vertex" | ||
|
||
def init(self, context): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to override method.
nodes/inputs/ScSingleVertex.py
Outdated
def init(self, context): | ||
super().init(context) | ||
|
||
def error_condition(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 :)