Beer glass scene creation
This course contains a little bit of everything with modeling, UVing, texturing and dynamics in Maya, as well as compositing multilayered EXR's in Photoshop.
# 1 08-06-2003 , 02:08 PM
Registered User
Join Date: Jun 2002
Location: Scotland
Posts: 129

Error! Help Please

Can someone please tell me what is wrong with this expression, it creates the expression but when i run it it says "an execution error occured in the creation expression for particleSplashShape. the expression is for the velocity of the particles,
also 1 more question, i created the ramp for it but what do i connec the ramp to.

thanks

Lespaul84

# 2 08-06-2003 , 02:11 PM
adldesigner's Avatar
Registered User
Join Date: Sep 2002
Location: CCS, Venezuela
Posts: 3,363
# 3 08-06-2003 , 02:13 PM
Registered User
Join Date: Jun 2002
Location: Scotland
Posts: 129
oops here is the code

string $placenode = "placement2dSplash";
string $tex_val = "ramp_Splash.outAlpha";
float $dynamics = 0.5;
vector $tmp = particleSplashShape.position;
float $x = $tmp.x;
float $z = $tmp.z;
float $map_x;
float $map_z;
// Remap the x and z into u and v values.
// Remap function. Assuming the size is 1.5 unit square.
$map_x = ($x + 0.75)/1.5; //normalize
$map_z = ($z + 0.75)/1.5;
setAttr ($placenode + ".ucoord") $map_x;
setAttr ($placenode + ".vcoord") $map_z;
float $offset = getAttr ($tex_val);
float $vy = $offset + rand (4.0,6.5);
float $vx = 0.0 * noise (time);
float $vz = 0.0 * noise (time);
particleSplashShape.velocity = <<$vx, $dynamics*$vy, $vz>>;

ps can someone delete the other post that has this in it, didnt mean to put it there, thanks

# 4 08-06-2003 , 09:14 PM
twisteddragon33's Avatar
Registered User
Join Date: Apr 2003
Location: New York, USA
Posts: 1,945
*blink*


________________________
AIM: SublimeDragon33
Catch me if i'm on. Always up for a chat.
e-mail: sublimedragon33@gmail.com
# 5 08-06-2003 , 10:45 PM
Nem's Avatar
Subscriber
Join Date: May 2002
Location: Faringdon, UK
Posts: 1,480
looks like sumthing for rage or kbrown :S


- Simon

My Website: www.Glass-Prison.com
# 6 08-06-2003 , 11:13 PM
Darkware's Avatar
Subscriber
Join Date: Oct 2002
Location: USA
Posts: 1,172
or Mark. :-)

# 7 08-06-2003 , 11:15 PM
dannyngan's Avatar
Registered User
Join Date: Dec 2002
Location: Seattle, WA
Posts: 1,154
Admins: Please move thist thread to the MEL Scripting and Programming forum. More appropriate than the lounge area.


Danny Ngan
Animator | Amaze Entertainment
my website | my blog | my job
# 8 09-06-2003 , 05:20 AM
adldesigner's Avatar
Registered User
Join Date: Sep 2002
Location: CCS, Venezuela
Posts: 3,363
# 9 09-06-2003 , 10:09 AM
mark_wilkins's Avatar
Registered User
Join Date: Jan 2003
Posts: 161
There may be more problems than this, but as was pointed out in the 3dbuzz forum, it's uCoord and vCoord, not ucoord and vcoord.

That said, your script isn't the best way to do this. You can create a particleSamplerInfo node and hook it up to your particles, set up a mapping to U and V outputs, and hook that node up to a texture. Your particles will render much much faster and you'll get the result you need possibly with no scripting at all...

However, that approach only works with the software render types... so maybe you're stuck if you absolutely have to have hardware rendered particles, but most of the time you can get the results you want with software render types...

-- Mark


Mark R. Wilkins
author of MEL Scripting for Maya Animators
www.melscripting.com
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