PDA

View Full Version : How to connect float attr to enum attr type?


tredeger
10-01-2006, 11:40 PM
I would like to connect a float attr (which will always be a whole number in use) to an attr of the enum type which, as I understand it, only takes integer values. Is there a way to do this? Perhaps by piping it through a node that will convert the float to an int? Thanks in advance for any help.

benject
10-03-2006, 06:07 PM
hi..maybe you can restore the float attr in an array and use the index of it to connect to the enum attr?
i am not sure about it ...cause i havnt tried it in maya...

kojala
10-04-2006, 06:12 AM
try this:

float $stuff = 5.5;
int $stuff_2 = $stuff;

the result from $stuff_2 is 5.

tredeger
10-05-2006, 02:35 AM
try this:

float $stuff = 5.5;
int $stuff_2 = $stuff;

the result from $stuff_2 is 5.

Sorry, I guess I wasn't clear. I'm trying to connect 2 attrs between 2 nodes in the DG. No MEL script involved except in the operation of connecting them up. I want the DG to take care of everything else.

The problem is that the attrs are of different types. I need some kind of conversion node to recast the outgoing plug's value into the type of the incoming plug. I think there must be some kind of node to do this, but I can't find it anywhere. You see some commands with a -scn flag -- a "skip conversion nodes" flag, so does anyone know what those are, if they apply to what I'm trying to do, and how to use them?

Thanks for the suggestion though. And thanks to everyone for any help they can lend.

cheers!

CGTalk Moderation
10-05-2006, 02:35 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.