correctly importing pivots

Is there anything that you would like to see in future versions of RealFlow?
Post Reply
User avatar
FlorianK
Posts: 238
Joined: Fri Jun 11, 2010 9:56 am
Location: Cologne, Germany

correctly importing pivots

Post by FlorianK » Thu Dec 09, 2010 11:46 am

when I import a particle seq into Maya, the pivot in Maya is set to the world space origin. I'd prefer if the pivot was either at the emitters original pivot or at the particle clouds center of mass (final frame).

The latter, I can write for myself in MEL, but it was nice to have the first at least as an option when importing.

User avatar
FlorianK
Posts: 238
Joined: Fri Jun 11, 2010 9:56 am
Location: Cologne, Germany

Re: correctly importing pivots

Post by FlorianK » Fri Jan 28, 2011 3:54 pm

Just in case you need an "Align RF particle sequence" script in Maya, but you are too lazy to code it for yourself:

Code: Select all

string $nodes[]  = `ls -sl`;
vector $scaleSource;
vector $trnlSource;
vector $rotPivotSource;
vector $sclPivotSource;

int $cnt = 0;

for ($n in $nodes)
{
	if (`objectType $n`	== "transform")
		{
			// case source
			if($cnt == 0)
			{
				$scaleSource = `getAttr ($n + ".scale")`;
				$trnlSource = `getAttr ($n + ".translate")`;
				$rotPivotSource = `getAttr ($n + ".rotatePivot")`;
				$sclPivotSource = `getAttr ($n + ".scalePivot")`;
				$cnt += 1;
				continue;
			}
			// case target
			if($cnt == 1)
			{
				// set pivots first
				setAttr ($n + ".rotatePivot") ($rotPivotSource.x) ($rotPivotSource.y) ($rotPivotSource.z);
				setAttr ($n + ".scalePivot") ($sclPivotSource.x) ($sclPivotSource.y) ($sclPivotSource.z);
				setAttr ($n + ".scale") ($scaleSource.x) ($scaleSource.y) ($scaleSource.z);
				setAttr ($n + ".translate") ($trnlSource.x) ($trnlSource.y) ($trnlSource.z);
				
				print ("\n Done.");
				
			}
			else
			{
				print ("no more than two nodes possible!");
				
			}
		}
};

User avatar
Hector
Site Admin
Posts: 15
Joined: Thu Jun 10, 2010 11:55 am

Re: correctly importing pivots

Post by Hector » Fri Feb 04, 2011 10:07 am

Thank you very much Florian :)
Hector Artal
RealFlow | Cinema4D developer
Next Limit Technologies

Post Reply