working pivot by 2 points

Hello
I'd like to know if anybody have already/want to do a script to set working pivot by 2 clicks : one for position, second one for x axis (for eg).
Could be really usefull. Thanks. :-)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
titane357's picture

hello Thanks for your

hello
Thanks for your efforts. Sorry for my silence I was busy...
"I think simply switching to the rotate tool (E) would be a better idea after
the pivot is placed "
Yes. But I'm precision addicted, and I would like to align X direction with a snap click on a vertex...
I can use other tools to rotate precisely, but the tool will be a pain to use...

br0t's picture

I was playing around a bit,

I was playing around a bit, and it seems that the option to activate the "Surface"-Button in the edit working pivot options is broken. Maybe someone can test that?
 WorkingPivot.setPlacePivotSurfaceMode true true
does not do anything for me.

I have found a weird workaround (based on Ian Farnsworth SkinReset Script) to press that button via MAXScript:

global gMaxHWND = windows.getMaxHWND() -- handle to 3ds Max
 
fn find_surface_button = 
(
	local maxChildren = windows.getChildrenHWND gMaxHWND -- all of 3ds Max's children elements
	for i = 1 to maxChildren.count do --loop through children of max handle
	(
		for k=1 to maxChildren[i].count do  --loop through the children of the children
		(
 
			if maxChildren[i][k] == "Surface" do --search by name
			(
				return maxchildren[i] -- return index of children
				exit
			)
		)--end for
	)--end for
)--end fn
 
WorkingPivot.EditMode = true
WorkingPivot.setPlacePivotViewMode true false -- wrong mode, but this will uncheck the "Align To View" checkbox
max hierarchy mode
global gThebutton = find_surface_button()
global gThebutton_handle = gThebutton[2] -- index 2 is the handle of that button
UIAccessor.pressButtonByName gThebutton_handle "Surface"

If you put that into a macroscript and then into a quad menu / toolbar it might be saving some time.
Now I still dont really know what you mean with that second click. Should it rotate on x Axis for 90 degrees depending in the direction of your mouse cursor or...? I think simply switching to the rotate tool (E) would be a better idea after
the pivot is placed.

Cheers

Never get low & slow & out of ideas

Anubis's picture

nice tip

Hi Br0t,
yes, WorkingPivot.setPlacePivotSurfaceMode function is broken.

Its not even described in the help, and I need to call showinterface WorkingPivot to see that it exist.
Nice UIAccessor tip.

my recent MAXScripts RSS (archive here)

br0t's picture

It is described in the Max

It is described in the Max 2011 Help files though:

<void>WorkingPivot.setPlacePivotSurfaceMode <boolean>on <boolean>alignToView
 
Controls the state of the Place Pivot To Surface mode. 
 
If the first argument is true, the Place Pivot To Surface mode will be enabled.
 
If the first argument is false, the Place Pivot To Surface mode will be disabled.
 
If the second argument is true, the Align To View option will be checked.
 
If the second argument is false, the Align To View option will be unchecked.

Good to know its not only me where its not working ;)

Never get low & slow & out of ideas

Anubis's picture

poor docs in Max 2009

Yep, in my Max 2009 help files exist only this :)

WorkingPivot.EditMode
WorkingPivot.UseMode
WorkingPivot.AxisSize
WorkingPivot.AxisDrawOnTop
WorkingPivot.AxisConstantScreenSize
WorkingPivot.getTM()
WorkingPivot.setTM

my recent MAXScripts RSS (archive here)

br0t's picture

what do you mean exactly?

what do you mean exactly? first click would set the working pivot to the position you have clicked on, and second click would do...?

Never get low & slow & out of ideas

titane357's picture

hello, thanks for reply

hello, thanks for reply :-)
It is "easy" to positionnate working pivot on a vertex, but it very difficult to set its rotation easily.
The two clicks should determinate a direction : X axis for example.
Yes a third click could set the Y axis ?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.