Tuesday, 26 October 2010

More Particle Transformy Stuff I should really know..

In the unlikelihood that anyone but myself reads this "blog", all credit to Sathish Kumar from chennai, working in Nipuna Services. Tutorial found on Creative Crash, via CGTalk forums.Whew.

Step 1:

Create any Geometical object and Assign any Texture and then Convert it to File Texture.
Create a surface emitter from that object and turn on Need Parent UV.
Add rgbPP attribute to particleShape1.
Assign the Baked File Texture to the emitter1 color .
Turn on inherit color in emitter1.
Set the conserve attribute to zero in the particle.
Set the emitter rate attribute to 5000.

Step 2:

Create any Geometical object and Assign a different Texture and then Convert it to File Texture.
Create a surface emitter from that object and turn on Need Parent UV.
Add rgbPP attribute to particleShape2.
Assign the Baked File Texture to the emitter2 color .
Turn on inherit color in emitter2.
Set the conserve attribute to zero in the particle.
Set the emitter rate attribute to 5000.

Step 3:

Play the TimeSlider and after the objects getting filled with the particle's Stop the TimeSlider.

Step 4:

Set as Initial state for both the particles.Delete the emitters from the object so the particles be independent. Now open the particleShape1 attribute editor and add the runtime expression in the position attribute as follows

particleShape1.position=hermite(particleShape1.position,particleShape2.position,
<<0,0,0>>,<<0,0,0>>,smoothstep(rand(0,2),rand(3,3.5),time));

and add the runtime expression in the rgbPP attribute as follows
particleShape1.rgbPP=hermite(particleShape1.rgbPP,particleShape2.rgbPP,
<<0,0,0>>,<<0,0,0>>,smoothstep(1,rand(1.5,3),time));


Play the scene and Enjoy the Particle Morph.

Tuesday, 19 October 2010

Particle magick

Particles flowing along a curve (obvious stuff I should know)

  • make particle & emitter
  • make curve
  • set curve as goal
  • select particle, in attr. editor, add the goalU and goaloffset attrs.
  • goalU+=0.1 or whatever
  • goaloffset is so the particles are around the curve, not just ON it.
  • Use something like sphrand (<<2,2,2>>) for that.
  • Profit.

Monday, 11 October 2010

stretchy limbs redux

  • seems as if it's important to have a master global scale in the baseCtrl.
  • everything should be parented under the baseCtrl..
  • 1/masterGlobalScale should be applied to the bendy chain joints.
  • use of distance nodes to spread the chain joints is definitely the way to go in conjunction with translateX
  • the root of the chain joint's immediate child should sit right on top of itself, for the bending to work
  • use rotation of bendy joints to create bending
  • IKctrl should be a shape of sorts, parented under baseCtrl. It should hold a locator for distance purposes and also the IK itself.

Tuesday, 14 September 2010

Stretchy Bendy Rig

For main part -
3 chains - IK, FK & Result
Use Blend Color nodes to feed rotation values of IK/FK into Result Joints
Similarly use Blend Color nodes to switch between stretching of joints (feed into scaleX usually)
Generally for IK stretching, parent the IKhandle to some sort of control object. Point constrain the distance node locators to the control object and not the IKhandle. (remember dgdirty as well)

FKstretch for bendy is -

FKstretchFactor x length
Divide by number of bendy joints.
Subtract original translationX to gain offset
Add offset to whatever original translation X was (this part could be streamlined)


IKstretch for bendy is the same.

Point constrain top and bottom joints of bendy chain to appropriate result joints. Orient constrain appropriately too, so that middle joints will follow correctly when not bending.
For bendiness, drive translation Z or Y with a custom attribute, dividing by various factors to gain curve effect.
Would be worth experimenting with rotation instead of translation.


To do - make rigs scalable

Monday, 12 July 2010

modified locator -to- particle script... useful!

 Note to self - figure out why counter caps at 100?

// Nulls2Particles Script by Garry Runke

string $selection[] = `ls -sl`;                            // `ls -sl` = list selected, creates an array with all selected objectnames in it

float $counter = `particle -q -count $selection[0]`;    // Get the number of particles

for ($x=0; $x<$counter; $x++)                           // Schleife läuft sooft wie Partikelanzahl
{

    string $part = $selection[0]+".pt["+$x+"]";             // This line builds the string representing the current particle (important for the next line)
    spaceLocator;        // Creates a locator at position 0 0 0
for($i=0; $i<200; $i++)
{    currentTime $i;
    float $partPos[2] = `getParticleAttr -at worldPosition $part`;    // Get the coordinates for each particle
    move -a  $partPos[0] $partPos[1] $partPos[2];            // Moves the locators over the particles
    setKeyframe;
}
};

Wednesday, 19 May 2010

Note to self. Recently resolved resolutions.

At the beginning of the year I resolved I would post on the blog more often, I'd get to work on an indie game, I'd draw more & that I would travel a bit more.
So, after nearly 6 months how am I doing?

Posting on the blog started off well, but as always laziness took over.. It still functions well as somewhere to store handy Maya tips though.
Whilst I did start collaborating on two indie games, yes two, I've decided to cease work on both...just to maintain my sanity levels. I stare at 3d software all day long at work & it's incredibly difficult for me to load it up once I'm at home.
Have I been drawing more? Short answer, no. And travelling? Thus far I've been to Berlin & in a couple of weeks I'll be off to Italy for a friend's wedding. That travel target was rather easy to achieve :) There're even a couple of other destinations planned for this year.

In short, screw you Past Dave. I don't need your stinking resolutions.

Wednesday, 24 March 2010

More Maya hijinks

maya cycles eg,
parent constrain A to B, parent constrain B to A
breaks Maya.

Instead Constrain A to B, but turn off B's constrain to A
When you want A to control, turn off A's to B and turn on B's to A.

Use condition nodes and pair blends. Pair blends are generated when you set a key in such a cycle. Lock the pairblend nodes.
Its ok to delete keyframes AFTER you lock them.

Within condition node you need to use RGB to set states and values for certain nodes. In the case of A and B, you want to set the parent Constraint node to either 0 for normal, or 2 for blocked.
you also need to set the weight to 0 or 1. The final value is the pairblend  weight.

The downside/requirement of such a setup is you must keyframe every shape involved. eg you want to use A to move left to right, and B to go up and down, on keying you MUST key both shapes otherwise they override each other.