How to copy working pivot translation and rotation to local and world pivot?

How to copy working pivot translation and rotation to local and world pivot?

holchangomes
Participant Participant
934 Views
5 Replies
Message 1 of 6

How to copy working pivot translation and rotation to local and world pivot?

holchangomes
Participant
Participant

 

 

 

-- Get the working pivot transformation matrix
workingPivotTM = WorkingPivot.getTM()

-- Set the pivot values to match the working pivot transformation matrix
$.pivot = [workingPivotTM[4][1], workingPivotTM[4][2], workingPivotTM[4][3]] -- Set pivot translation

 

I got the translation to work, but couldn't do it for the pivot rotation.

0 Likes
935 Views
5 Replies
Replies (5)
Message 2 of 6

denisT.MaxDoctor
Advisor
Advisor
fn alignPivotToTM node tm = 
(
	itm = tm * (inverse node.transform)
	node.transform = tm
	node.objectOffsetPos *= inverse itm
	node.objectOffsetRot *= inverse itm.rotation
	node.transform
)

alignPivotToTM $ (WorkingPivot.getTM())
Message 3 of 6

holchangomes
Participant
Participant

 

The whole object moved, the pivot got where i want, but by rotating the entire object, not only just the pivot.

0 Likes
Message 4 of 6

denisT.MaxDoctor
Advisor
Advisor

explain clearly what you want... give a picture or example that illustrates what you exactly need

0 Likes
Message 5 of 6

holchangomes
Participant
Participant

to_forum_wkng_pvt.png

Sure, i have a script(basachii) that takes an edge or 2 vertex and use this to align a working pivot, but now i want this aligned with a vertex/edge working pivot to be the local pivot too.

0 Likes
Message 6 of 6

denisT.MaxDoctor
Advisor
Advisor

You are saying something that only you can understand... There is no such thing as a "local" or "global" pivot in 3DS MAX.
Let's try again... what and with what do you want to align?

0 Likes