Integrating 3D models with photography
Interested in integrating your 3D work with the real world? This might help
# 1 26-08-2004 , 03:11 PM
vladimirjp's Avatar
Subscriber
Join Date: Jun 2003
Location: stuck in the 90's boston, USA
Posts: 1,871

a script that moves the pivot at the origin

hello. i know there are a few MEL savvy mods on this forum, as MEL is not my favorite thing to do. this may seem like a simple 4-5 line script to most, but i've tried and all failed miserably. heh.. i won't even post my so called "code" as it was way off...
so please a little help to speed my modeling process and technique.

read title: a simple script that takes the pivot of object selected and places the pivot at the origin [0 0 0]any object type or mesh etc... ,


thanx in advance user added image:tup:

# 2 26-08-2004 , 03:39 PM
vladimirjp's Avatar
Subscriber
Join Date: Jun 2003
Location: stuck in the 90's boston, USA
Posts: 1,871
what i had....
string $selected[];
$selected = `ls -sl`;
vector $pivot = `xform -q -piv $selected`;
move $selected.rotatePivot $selected.scalePivot 0 0 0;

error i got : Error: line 3: Cannot convert data of type float[] to type vector due to array size mismatch (6 elements). //

# 3 26-08-2004 , 04:16 PM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
There... make shelf button of this or something...
Code:
{
	string $sSel[] = `ls -sl -typ transform`;
	string $sItem;

	for($sItem in $sSel)
	{
		setAttr ($sItem + ".scalePivot") 0 0 0;
		setAttr ($sItem + ".rotatePivot") 0 0 0;
	}
}


Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
# 4 26-08-2004 , 04:34 PM
vladimirjp's Avatar
Subscriber
Join Date: Jun 2003
Location: stuck in the 90's boston, USA
Posts: 1,871
thanx a million sensei KB:chinese:
:tup: :tired: Mel is on my next "to-learn" list

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads