pivot

I know there are a lot of scripts for centering of the object pivot point, but it is so confusing which of them to download and use! I use now only 2 options putpivotcenter(SHIFT+P) and putpivotbottom(CTRL+P) from soulburnscript! But putpivotbottom doesn't put the pivot on the bottom if for example I created the object(let's say a box) in the front view, for example!

May be you could advise any that really work and easy to use! Thx friends!

Comments

Comment viewing options

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

But I have an idea, how to

But I have an idea, how to make it work for groups! I will do it next week, because tomorrow morning I need to travel!

tassel's picture

This don't work with groups,

This don't work with groups, but this is something i made last year to a former work colleague. Just thought it might be useful for someone searching for pivot stuff.

-- Pivot Placer V1.0 - By Raymond H.Ingebretsen'2012
 
try(destroyDialog ::roll_pivottools)catch()
 
rollout roll_pivottools "Pivot Placer V1.0"
(
	-- UI Stuff!!!
	group "Place Pivot Z-Direction:"
	(
		button btn_CenterTopZ "Top Y" width:45 height:20 across:3
		button btn_CenterMiddleZ "Mid Y" width:45 height:20 
		button btn_CenterBottomZ "Bot Y" width:45 height:20 
	)
 
	group "Place Pivot X-Direction:"
	(
		button btn_CenterSideX "Side X" width:45 height:20 across:3
		button btn_CenterMiddleX "Mid X" width:45 height:20
		button btn_CenterSideOppositeX "Op.s X" width:45 height:20
	)
 
	group "Place Pivot Y-Direction:"
	(
		button btn_CenterFwdY "Fwd Y" width:45 height:20 across:3
		button btn_CenterMiddleY "Mid Y" width:45 height:20
		button btn_CenterAftY "Aft Y" width:45 height:20
	)
 
 
	-- Pivot in Z-Direction Top, Middle and Bottom
	on btn_CenterBottomZ pressed do
	(
		selection.pivot = [selection.center.x,selection.center.y,selection.min.z]
	)
 
	on btn_CenterMiddleZ pressed do
	(
		selection.pivot = [selection.center.x,selection.center.y,selection.center.z]
	)
 
	on btn_CenterTopZ pressed do
	(
		selection.pivot = [selection.center.x,selection.center.y,selection.max.z]
	)
 
 
	-- Pivot in X-Direction Side, Middle and Opposite
	on btn_CenterSideX pressed do
	(
		selection.pivot = [selection.min.x,selection.center.y,selection.center.z]
	)
 
	on btn_CenterMiddleX pressed do
	(
		selection.pivot = [selection.center.x,selection.center.y,selection.center.z]
	)
 
	on btn_CenterSideOppositeX pressed do
	(
		selection.pivot = [selection.max.x,selection.center.y,selection.center.z]
	)
 
 
	-- Pivot in Y-Direction Fwd, Middle and Aft
	on btn_CenterFwdY pressed do
	(
		selection.pivot = [selection.center.x,selection.min.y,selection.center.z]
	)
 
	on btn_CenterMiddleY pressed do
	(
		selection.pivot = [selection.center.x,selection.center.y,selection.center.z]
	)
 
	on btn_CenterAftY pressed do
	(
		selection.pivot = [selection.center.x,selection.max.y,selection.center.z]
	)
 
)
 
createDialog roll_pivottools height:155 width:170 pos:[200,250]
-- // EOF

Raymond H.Ingebretsen - http://www.homme3d.com

artrender.info's picture

it's very nice and easy to

it's very nice and easy to use!

tassel's picture

I see i have a typo after

I see i have a typo after renaming the buttons, you have to rename the Pivot Z-Direction buttons. :)

Raymond H.Ingebretsen - http://www.homme3d.com

artrender.info's picture

undefined -- Error occurred

undefined
-- Error occurred in anonymous codeblock; filename: E:\Soft\scripts\x\Textures\; position: 54; line: 3
-- Unknown property: "transform" in undefined
-- Error occurred in anonymous codeblock; filename: E:\Soft\scripts\x\Textures\; position: 73; line: 4
-- Unknown property: "dir" in undefined
-- Error occurred in anonymous codeblock; filename: E:\Soft\scripts\x\Textures\; position: 120; line: 5
-- Runtime error: Invalid coordsys context: undefined
-- Error occurred in anonymous codeblock; filename: E:\Soft\scripts\x\Textures\; position: 155; line: 6
-- Frame:
-- No ""get"" function for undefined

barigazy's picture

...

Hey Mike
This is the example not final code. Try in the listener to play

barigazy

artrender.info's picture

aa, ok, in fact I'm trying

aa, ok, in fact I'm trying allways in the listener, little by little - first

delete $'Point*'
grp = $Group001
tm = grp.transform
grp_dir = grp.dir
lbb = in coordsys tm nodeLocalBoundingBox grp
pivot_center_pos = ((lbb[1]+lbb[2])/2)*tm

with a selected object and group, but I took this error, that's why! Srry, may be I was a little confused!

artrender.info's picture

barigazy!

I don't understand, last time

obj = selection[1]
obj.pivot = [obj.center.x,obj.center.y,0] -- bottom position

was working for my groups, today it doesn't! Except this, it places the pivot at 0, but if my group is above or under 0?

barigazy's picture

...

my bad.

-- this works in world coord system
obj = selection[1]
obj.pivot = [obj.center.x,obj.center.y,obj.min.z]
-- for node (local) coord system is other story :)

barigazy

barigazy's picture

...the story continues

Let say we have "Group001"
Now for if you change position rotation or scale of it then try this example

delete $'Point*'
grp = $Group001
tm = grp.transform
grp_dir = grp.dir
lbb = in coordsys tm nodeLocalBoundingBox grp
pivot_center_pos = ((lbb[1]+lbb[2])/2)*tm
pivot_bottom_pos = (pivot_center_pos - (((abs(lbb[1]-lbb[2]).z)*grp.scale/2)*grp_dir))
pivot_top_pos = (pivot_center_pos + (((abs(lbb[1]-lbb[2]).z)*grp.scale/2)*grp_dir))
 
point name:"PointBottom" pos:pivot_bottom_pos dir:grp_dir cross:off axistripod:on size:10 wirecolor:blue
point name:"PointCenter" pos:pivot_center_pos  dir:grp_dir cross:off axistripod:on size:10 wirecolor:red
point name:"PointTop" pos:pivot_top_pos  dir:grp_dir cross:off axistripod:on size:10 wirecolor:yellow

barigazy

Comment viewing options

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