PDA

View Full Version : Instancer and blendshapes


triptych79
03-03-2009, 01:17 AM
Hi,

I have 3 different objects (say a sphere, cube and a cone) instanced to a particle emission. Each object has a blendshape. What I'm aiming to achieve is a type of blendShapePP. I've duplicated a sequence of each object's blendshape over 10 frames, and then added them in order to the instancer. So from 0-10 is the sphere blending, then from 11-20 is the cube blending, and so forth. What I would like to know is how to randomly assign each particle with a specific instance object value 0, 11, or 21 (the initial sphere, cube, or cone), and then for it to run through its 10 frame blend sequence and stop cycling on its final instance?

Any ideas? Thanks

azshall
03-03-2009, 02:39 AM
Do the blend shapes need to loop or just blend over the lifetime of the particle? Maybe try creating another PP attribute to use as a randomizer. Keep in mind, I haven't tested this as I'm about to leave work so this could be a tad flawed :) .. As well .. I am sure there is a way to simplify the expressions so they're not so fatty, but.. At any rate, should get you in the ballpark?

Creation expression..


if (randPP < 1.25) {
blendShapePP = 0;
} else if (randPP > 2.75) {
blendShapePP = 21;
} else {
blendShapePP = 11;
}


This way, you will always know that whatever is less than 1.25 will be the first blend animation. Whatever is above 2.75 will be the last blend animation and whatever is in the middle gets the second blend animation.

Then in your runtime expression you'll want something to iterate through the blendShapePP.

Runtime Expression:

if (randPP < 1.25) {
if (blendShapePP < 11) {
blendShapePP += 1;
} else {
blendShapePP = 0;
}
} else if (randPP > 2.75) {
if (blendShapePP < 31) {
blendShapePP += 1;
} else {
blendShapePP = 21;
}
} else {
if (blendShapePP < 21) {
blendShapePP += 1;
} else {
blendShapePP = 11;
}
}


...Btw, this will cause them to loop over and over.

triptych79
03-03-2009, 04:08 AM
What I was trying to do is get bubbles to be blown from a specific point (one of those ring things) and begin initially as default spheres, and then as they emit, blend to one of three new shapes and remain that way. Ideally, I'd also like to decrease their velocity somewhat as they get to the end of their blend (like a real bubble being blown from one of those bubble guns) - and then let a turb. field influence more of the motion.

CGTalk Moderation
03-03-2009, 04:08 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.