Ok, i will try that if statement at the beginning. It crashes either: 1. when i plug anything into it, correct or incorrect does not matter 2. when I have plugin loaded and try to create new scene in current Maya session
If I comment out the checking part, nothing from above mentioned happens ;) By moving it to connection methods, should I call them at the beginning of compute? Or return some status from them? (like unknown parameter) Never used those :( I am quite new to API :( 2008/9/25 Dean Edmonds <[EMAIL PROTECTED]> > > On Thu, Sep 25, 2008 at 5:42 AM, Mario Dubec <[EMAIL PROTECTED]> wrote: > > > > I used this ccecking in compute while I was translating one C++ node from > > devkit (particleAttributeNode I think). > > I would still recommend moving that code out to either the > legalConnection/legalDisconnection methods or > connectionMade/connectionBroken. I doubt that will fix your crash, but > it's a good start to cleaning up the compute(). > > The particleAttributeNode sample node is doing it the way that it is > because, quite frankly, it's badly written. The author tried to cram > what should be two different nodes into one and ended up with some bad > code as a result. > > > What I did not say in the script, but I have, is the final part of the > > computation: > > > > outputHandle = dataBlock.outputValue(node.debugMe) > > outputHandle.setString(result) > > dataBlock.setClean(plug) > > In that case you should only be executing your code when the plug > passed to your compute() method is for 'debugMe'. For all others your > compute() method should immediately return > om.MStatus.kUnknownParameter. > > > so I was expecting, when nothing is connected, the value would be 0 and > > stage 4 > > when I connect appropriate nodes, value would be 1 and stage 4 > > > > but I get crash only :( > > At which stage does it crash? > > -- > -deane > > > > --~--~---------~--~----~------------~-------~--~----~ Yours, Maya-Python Club Team. -~----------~----~----~----~------~----~------~--~---
