Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Maxscript - Finding NURBSCVSurface sub-object world position coordinates

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
michael.driscoll
607 Views, 4 Replies

Maxscript - Finding NURBSCVSurface sub-object world position coordinates

I'm trying to access the world position coordinates of the control vertices in a NURBSCVSurface sub object.

 

The position is always returned as a value relative to the centre of the sub object rather than relative to the world coordinates.

I don't know how to access the pivot point coordinates of the NURBSCVSurface sub object.

If I did, I would just add these to the relative coordinates to get my answer.

 

 

I've included a v. simple script below to see what I mean.

To test it, create a simple CV Surf (Create-->Geometry-->NURBS Surfaces-->CV Surf) that isn't centered around the origin (I couldn't attach files for some reason).

 

 

objNode = $Surface001
objNode.pos
classof(objNode)

getset = getNURBSSet objNode #relational 

-- Get the first NURBSCVSurface sub-object:
obj = getObject getset 1

-- Output name of the sub object to listener:
obj.name

-- Output position of the first control vertex to listener
position = (in coordsys local getCV getSet[1] 1 1).pos

-- Apply transform to convert to world coordinates (doesn't work):
trnsform = obj.transform
worldPosition = (position*trnsform)	

 

 

 

Atmospheric
4 REPLIES 4
Message 2 of 5

Most app-specific filetypes will not attach directly - Zip (not .rar or .7z or anything else, just zip) the file and it should attach, provided it does not exceed the permitted file size (5MB).

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

Message 3 of 5

Files attached as zip file. 🙂

Atmospheric
Message 4 of 5
Message 5 of 5

Thanks Swordslayer!
It worked a treat. 🙂
Atmospheric

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report