PDA

View Full Version : How to drive user data by selecting object?


danb
11-16-2005, 03:25 AM
I've got a boolean user data set to drive a cdik morph mixer. I want to be able to select an object in the viewport to turn on the boolean user data and when that object is not selected i want the user data boolean to be unchecked.

Is this possible? I haven't seen anything like this before on the forums so maybe not.

Per-Anders
11-16-2005, 03:41 AM
yup you'll use either a coffee tag, or a coffee node in Xpresso, then you simply check the objects active bit:

if (op->GetBit(BIT_ACTIVE)) {
//do something
}

in a COFFEE tag "op" is the object that the tag is on, in xpresso of course you would just add an input with the object and the name "op" for the input for this to work. and where you have "//do something" you might set the output value to be TRUE or FALSE if it's a node, or if it's a tag then simply directly set the checkbox however you want.

danb
11-16-2005, 07:41 PM
Thank you very much. I'm not to savvy with coffee but i'll figure it out. This can be done in 8.5 right?

Per-Anders
11-16-2005, 07:53 PM
yup, this should work just fine in 8.5

danb
11-17-2005, 04:27 AM
Ok i've been trying to get this to work but i just can't understand this. Could you post an example file please?

Per-Anders
11-17-2005, 05:13 AM
just set up an xpresso network with your object you want to test, a coffee node, and the node with your bool on it. remove the inputs and outputs from teh coffee node, add one input that's a "link" type and an output that's a "bool" type, in the coffee node edit it so that it reads:

main()
Output1=Input1->GetBit(BIT_AOBJ);
}

then plug in the test object to the coffee objects input, and the output of the coffee node to the bool value you want to control.

the only downside with this is that in r8.5 you there wasn't an EventAdd() call to force an update when needed, and the xpresso doesn't execute till after something happens in viewport (i.e. if you start moving the selected object then the bool will update, but not after simply selecting).

danb
11-17-2005, 05:30 AM
Thanks mdme sadie that change worked better. Cactus Dan was helping too and he got it to work with r9 but not r8.5 until he saw your changes. Now it works fine.

danb
11-17-2005, 10:47 AM
I have followed your advice and made the boolean drive the morph mixer. This is working great.

However i noticed when i do this it animates like stop motion animation. This may be the final animation type anyways. Although now the question becomes, can i do the same effect but make it so i can animate with smooth transitional keyframes?

I am trying to mimick what is going on in Davide La Sala's demo reel found here: http://www.davidelasala.com/video/davidelasala_showreel_2005.mpg .

In this movie it shows the animation controls in the maya viewport. The artist simply selects a face thumbnail and a morph is turned on.

I believe a lot of people could benefit from this technique so i am trying to find help in producing it.

unseenthings
11-17-2005, 02:26 PM
I have followed your advice and made the boolean drive the morph mixer. This is working great.

However i noticed when i do this it animates like stop motion animation. This may be the final animation type anyways. Although now the question becomes, can i do the same effect but make it so i can animate with smooth transitional keyframes?

I am trying to mimick what is going on in Davide La Sala's demo reel found here: http://www.davidelasala.com/video/davidelasala_showreel_2005.mpg .

In this movie it shows the animation controls in the maya viewport. The artist simply selects a face thumbnail and a morph is turned on.

I believe a lot of people could benefit from this technique so i am trying to find help in producing it.

I'm no expert, but I'm about 99% sure those aren't morphs. (at least for the first batch of little guys) They're bitmaps. And clicking on one of those turns on the specific bitmap... that should be quite easy to do in cinema. The eyes and the mouth are all bitmaps and clicking on one selects it. The only morph I see is the trumpet, which has a yellow dot bitmap, and a slider for the face morph with the trumpet going out and coming back in.

Does that help any? I'll see if I can put together an example later today.

unseenthings
11-17-2005, 04:10 PM
I've made a simple example based on that movie and the code provided above. The way I did it was this: one main shader texture mapped onto the sphere, where I set up a number of layers, with a set of "eyes" on each one. Using the coffee that mdme_sadie provided, each object selected would set the blend for that layer to 1 (or true, or 100%) and the rest to false. There's also a default set of eyes (looking straight ahead) at the bottom so if none are selected, he'll still have eyes.

It's not particularly elegant... I think a much better solution could be achieved with coffee, and/or more xpresso. One problem you have is that it doesn't update in the viewport (unless you have Sniper Pro or something -- then you can get realtime updates). I'm not sure if there's a way around that or not. EventAdd didn't work for me in this case. Another problem is that you'd probably want it to stay on whichever set of eyes you selected last rather than just what's currently selected... but again, this wasn't meant to be an all-in-all solution, but an example/starting point. If other people wanted to enhance this sample and re-upload it, that'd be great.

Screenshot:
http://www.unseenthings.net/cgtalk/animated_eyes_screenie.jpg

Get the scene file (http://www.unseenthings.net/cgtalk/animated_eyes_example.zip)(9.5 format) (http://www.unseenthings.net/cgtalk/animated_eyes_example.zip)here. (http://www.unseenthings.net/cgtalk/animated_eyes_example.zip)

Hope it helps... I *think* you should still be able to open this file in Cinema 8.5?? If not, I can post screenshots of the layers and xpresso setup and such.

danb
11-17-2005, 04:34 PM
Thanks ascent that is exactly how it is done in the demo video.

I guess i should have been more specific. I would like the same effect only to turn morphs on and off. So what i would like to do is have those face thumbnails be renders of my morphs and when one thumbnail is selected it will turn on one morph to %100.

I thought i could do this with a boolean user data that drives my cd morph mixer. Although now i think i don't really need the boolean user data. I think i can connect the morph mixer tag directly to the coffee node.

What do you think of this?

Daxx
08-10-2006, 10:27 PM
:thumbsup: eheheheh

CGTalk Moderation
08-10-2006, 10:27 PM
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.