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 21-09-2013 , 01:30 PM

Someone that likes Maya but suffers to master it :p
Join Date: Sep 2013
Posts: 10

Bullet physics MEL expression HELP!!

Hi

I have a ball in maya bullet physics, I want its velocity in (x) direction to have a certain value (-5 for example) but at frame 100

I wrote an expression for that but maya gives me error message for it:

//Error:attributes must be of float,integer , or boolean types:

what did I do wrong? is this expression correct?

if (frame <100)
bulletRigidBodyShape1.initialVelocity = << 0 , 0 , 0 >>;
else bulletRigidBodyShape1.initialVelocity = << -5 , 0 , 0 >>;

screenshot here if needed..
https://img102.imagevenue.com/img.php..._122_404lo.jpg

Last edited by black H; 21-09-2013 at 01:31 PM. Reason: correcting

# 2 21-09-2013 , 02:09 PM

EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
Try initialVelocity.x = -5 so it's not a vector.

# 3 21-09-2013 , 02:36 PM

Someone that likes Maya but suffers to master it :p
Join Date: Sep 2013
Posts: 10
Hi,
Yes I tried as you said bulletRigidBodyShape1.initialVelocity.x= -5;
but It gave me the same error:
//Error:attributes must be of float,integer , or boolean types:

Am not sure if the intial velocity inside bullet physics is a vector

also my MEL knowlge is soo poor, I don't have experience with , I just copy past mel codes from the net to maya

I need it cause I want to make the velocity work after a certain frame in the simulation and not from the begnning

Last edited by black H; 21-09-2013 at 02:38 PM. Reason: correction

# 4 21-09-2013 , 09:27 PM

Super Moderator
Join Date: Dec 2006
Location: South FL
Posts: 3,522
You'll have to use the "setAttr" command in this case and specify what kind of data. This attribute takes three float values, it's easy to find out just enter this into the command line:

Code:
`getAttr -type bulletRigidBodyShape1.initialVelocity;`
and the result will be:

Code:
`// Result: float3 //`

Using the type flag ensures Maya won't misinterpret the code and throw a syntax error

Code:
```if(frame<100)

setAttr bulletRigidBodyShape1.initialVelocity -type float3 1.000 2.000 3.000;
else
setAttr bulletRigidBodyShape1.initialVelocity -type float3 0.000 0.000 0.000;```

Hope that helped.

- Genny
__________________
::|| My CG Blog ||::
::|| My Maya FAQ ||::

# 5 22-09-2013 , 11:35 AM

Someone that likes Maya but suffers to master it :p
Join Date: Sep 2013
Posts: 10
@ Gen , wow your method works

yes I tested it, and it's working,, this is a great help here, thank you

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

Topics

8

By e11productions Animation
0

0

3

5

2

VFX News

On 2022-07-18 14:30:13

On 2022-07-18 14:17:59

On 2022-07-15 13:14:36

On 2022-05-13 13:52:25

On 2022-05-02 20:24:13

On 2022-04-13 16:02:13