Get the 2 CVs from a curveu on a NURBS curve.

   362   4   2
User Avatar
Member
38 posts
Joined: Dec. 2014
Offline
Hello,

I have a NURBS curve and I want to grab the before and after CVs depending on the provided curve u value. Anyone got any ideas how I could do this?

Thanks

Edited by JohnDoe777 - Dec. 31, 2024 09:12:52

Attachments:
curve_example.png (244.2 KB)

User Avatar
Member
343 posts
Joined: Nov. 2013
Offline
Are you looking for a python script/tool? Or a sop network that places whichever two points in a group?
User Avatar
Member
38 posts
Joined: Dec. 2014
Offline
antc
Are you looking for a python script/tool? Or a sop network that places whichever two points in a group?

Sorry probably should have clarified. A python script preferably. Need it as part of a viewer state for creating curves and having the option of inserting new CVS along the curve.
User Avatar
Member
8854 posts
Joined: July 2007
Online
maybe an overkill to dig through, but you can probably find what you are looking for in the Curve viewer state since it also supports adding new CVs to NURBS curves
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
343 posts
Joined: Nov. 2013
Offline
I'm not sure how the curve sop does things, but to insert at a particular u position and have the CV's update you might be able to use the carve sop verb. Something like

carve_verb = hou.sopNodeTypeCategory().nodeVerb("carve")
carve_verb.setParms({'domainu1': u_value, 'keepout': 1})
carve_verb.execute(geometry, [input_geometry])

EDIT: refine verb is probably a better choice to add a break point.

Try this in a python sop as an example, with a curve sop plugged into the first input of the python sop.

node = hou.pwd()

new_geo = hou.Geometry()

refine_verb = hou.sopNodeTypeCategory().nodeVerb("refine")
refine_verb.setParms({'domainu1': 0.1})
refine_verb.execute(new_geo, [node.input(0).geometry()])

node.geometry().clear()
node.geometry().merge(new_geo)
Edited by antc - yesterday 11:06:37
  • Quick Links