Notifications
Clear all

[Closed] How to query the state of the coordinate system center?

I’m sure this is quite a noobish question but I’ve just moved over to Max and trying to learn it’s scripting language.

I am trying to make a toggle for switching between Pivot Point Center and Selection Center of the coordinate system. But I don’t know what object I have to query for this information (I have checked the documentation).

Rough outline of the script, with unknown areas marked with ???

-- Query active state
state = ???

-- Switch
case (???) of
(
???: toolMode.pivotCenter()
???: toolMode.selectionCenter()
???: toolMode.selectionCenter()
-- Last one because I never want Transform coordinate center
)
2 Replies

Everything is written in the maxscript help file:


(
	curState = getCoordCenter() 
	if curState == #local do toolMode.selectionCenter()
	if curState == #selection do toolMode.pivotCenter()
	if curState == #System do toolMode.pivotCenter()
)

Thank you. Works like a charm.