hoknamahn Posted October 4, 2007 Share Posted October 4, 2007 How? Quote Link to comment Share on other sites More sharing options...
Daniel Posted October 4, 2007 Share Posted October 4, 2007 How? OP_Context Class long getFrame () const float getFloatFrame () const so you just do context.getFrame(); D Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted October 4, 2007 Author Share Posted October 4, 2007 OP_Context Class long getFrame () const float getFloatFrame () const so you just do context.getFrame(); D Cheers Daniel! What about fps? I don't see it in this class definition. Quote Link to comment Share on other sites More sharing options...
Daniel Posted October 4, 2007 Share Posted October 4, 2007 Cheers Daniel! What about fps? I don't see it in this class definition. oh right, FPS. I know in pops there's: POP_ContextData* data = (POP_ContextData*) context.myData; data->myTimeInc Not sure about general fps though Quote Link to comment Share on other sites More sharing options...
edward Posted October 4, 2007 Share Posted October 4, 2007 You can get at the global channel manager. CH_Manager *mgr = OPgetDirector()->getChannelManager() mgr->getEvaluateTime(); // current evaluation time mgr->getSamplesPerSec(); // get FPS mgr->getGlobalStart(); // get global animation start time mgr->getGlobalEnd(); // get global animation end time Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted October 5, 2007 Author Share Posted October 5, 2007 (edited) Thank you guys. One more question: how to force sop to recook in each frame even if parameters or inputs doesn't change? Edited October 5, 2007 by hoknamahn Quote Link to comment Share on other sites More sharing options...
edward Posted October 6, 2007 Share Posted October 6, 2007 Prior to cooking it, call sop->forceRecook(); Or in the SOP's cookMySop() method, call ourFlags().setAlwaysCook(true); Quote Link to comment Share on other sites More sharing options...
sibarrick Posted October 6, 2007 Share Posted October 6, 2007 Prior to cooking it, call sop->forceRecook(); Or in the SOP's cookMySop() method, call ourFlags().setAlwaysCook(true); I've used OP_Node::flags().timeDep = 1; before too. Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted October 6, 2007 Author Share Posted October 6, 2007 (edited) Prior to cooking it, call sop->forceRecook(); Or in the SOP's cookMySop() method, call ourFlags().setAlwaysCook(true); Where I can call forceRecook()? As I understand I have 3 choices: constructor, destructor and cook method? I've tried ourFlags.setAlwaysCook(true); sop still cooks only in the first frame. Simon's OP_Node::flags().timeDep = 1; works great. But anyway I still would like to know all solutions so if you have a time edward could you explain in details? Cheers guys. Edited October 6, 2007 by hoknamahn Quote Link to comment Share on other sites More sharing options...
edward Posted October 6, 2007 Share Posted October 6, 2007 The forceRecook() is for dirtying a SOP for cooking whenever the next time its data is obtained. This is more often used for example in a callback function to a button parameter press in order to force the SOP to recook. Note that the SOP in that case won't actually recook until someone asks for its data (eg. the viewer). So if it's not displayed, then the SOP won't actually cook yet (unless of course you call its cook() method explicitly). Sorry, I was mistaken that the always cook flag would work when changing time. The ourFlags().setTimeDep(true) method works better. This will let the viewer know that the node is time dependent and will ask for the node (if displayed) to cook every frame. This flag should always be set somewhere in the cookMySop() method because it gets cleared prior to cookMySop() is called. After cookMySop() is done, this flag is automatically set if any of the evaluated parameters are time dependent. So this flag is cleared prior to cookMySop() because the parameters may have been changed to no longer be time dependent. Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted October 6, 2007 Author Share Posted October 6, 2007 Thanks for the explanation edward! Quote Link to comment Share on other sites More sharing options...
dave_o Posted July 6, 2016 Share Posted July 6, 2016 Sorry for resurrecting an ancient thread, but I have a follow up question to the above. I'm trying to write a GEO_IOTranslator and I need to get the current frame. There doesn't seem to be a context available to call getFrame() with. I've tried CHgetEvalTime() as well, but this always seems to return 0. Quote Link to comment Share on other sites More sharing options...
edward Posted July 9, 2016 Share Posted July 9, 2016 I don't think you can because the GEO_IOTranslator is only given the already cooked geometry. The only workaround I can think of is adding a detail attribute to your geometry with the value of $FF. Quote Link to comment Share on other sites More sharing options...
dave_o Posted July 13, 2016 Share Posted July 13, 2016 Thanks for the idea Edward. I ended up using a soho script with python instead. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.