Lonely Compute Function

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 11 November 2005   #1
Lonely Compute Function

Hi Folks,

This is probably a simple and common one, but it's got be baffled. I'm writing a simple utility node that lerps between two values (vectors or scalars) given a param attr. I've set everyting up as I've done in other nodes that have worked fine, but in this case my compute function is never getting called.

I have the node in a graph such that it's output is going into the translate of a locator, yet I notice several peculiar things (aside from the fact that it's just not working). First, when one of the input objects is selected, there is no color que that the locator is being affected by the input object. Second, in the DG, when I RMB on my node I do not get my output listed.

I have double checked that the attributes are being added (and they are), and I have set up every possible attributeAffects combination possible.

Does anyone have any ideas?

Thanks

Ron Griswold
R!OT Santa Monica
rgriswold@rioting.com
 
Old 11 November 2005   #2
Hi,

Two suggestions:

1. Put a debug breakpoint in your initialization code OR include some print statement there for debug purposes. This will tell you if your initializing routine gets called at all. If this works, do the same for your compute function. I would believe that they are not executed for some reason.

2. If they are not executed, check that your overloaded function declarations have the exact same declarations as the base functions - do not forget the const keyword for instance.

Good luck
/ Daniel
 
Old 11 November 2005   #3
to get the pink "i'm affected colour", connect a message attribute between the two nodes. To get the RMB working in the Hypergraph, you need to provide an MPxDragAndDropBehaviour class with your plugin.

To get the node to update correctly, ensure that you output attr is NOT writable, NOT storable, NOT keyable and IS readable. Then just do

attributeAffects(input,output);

The compute will not be called unless the output attribute is connected to something....
 
Old 11 November 2005   #4
Thanks folks.

jdj - Everything about the node worked (i.e. initialization was fine) but the compute wasn't being called. The function signature did match. I did find the solution though (see below).

Robert - Thanks for the tip on the message attribute.

The solution to my problem was that I was in fact setting keyable to true on the outputs (copy and paste - bad! )

Thanks guys!
 
Old 11 November 2005   #5
Thread automatically closed

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.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 03:11 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.