SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Mel Scripts & Programming / a script that moves the pivot at the origin
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 26-08-2004, 03:11 PM   #1
vladimirjp
Subscriber
 
vladimirjp's Avatar
 
Join Date: Jun 2003
Location: stuck in the 90's boston, USA
Posts: 1,871
Thanks: 0
Thanked 4 Times in 3 Posts
Default 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 :tup:
__________________
Image dump
vladimirjp is offline   Reply With Quote
Old 26-08-2004, 03:39 PM   #2
vladimirjp
Subscriber
 
vladimirjp's Avatar
 
Join Date: Jun 2003
Location: stuck in the 90's boston, USA
Posts: 1,871
Thanks: 0
Thanked 4 Times in 3 Posts
Default

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). //
__________________
Image dump
vladimirjp is offline   Reply With Quote
Old 26-08-2004, 04:16 PM   #3
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

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!
kbrown is offline   Reply With Quote
Old 26-08-2004, 04:34 PM   #4
vladimirjp
Subscriber
 
vladimirjp's Avatar
 
Join Date: Jun 2003
Location: stuck in the 90's boston, USA
Posts: 1,871
Thanks: 0
Thanked 4 Times in 3 Posts
Default

thanx a million sensei KB:chinese:
:tup: :tired: Mel is on my next "to-learn" list
__________________
Image dump
vladimirjp is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.