BrianK Posted February 25, 2005 Share Posted February 25, 2005 While I'm sure I can fight my through creating a non-IFD ROP driver, I'd rather not. Does anyone have a *complete* simple example of a non-IFD ROP driver? Quote Link to comment Share on other sites More sharing options...
malexander Posted February 25, 2005 Share Posted February 25, 2005 The model for a ROP is fairly simple; it uses 3 basic methods: virtual int startRender(int nframes, float tstart, float tend); virtual ROP_RENDER_CODE renderFrame(float time, UT_Interrupt *boss); virtual ROP_RENDER_CODE endRender(); startRender() is called before any frames are rendered; it will let you know how many frames are about to be rendered, the start time and the end time. Return 1 if you can proceed with the render, 0 for failure. renderFrame() is where you do the output work for a given frame. (boss is usually null, if you want to put interruption queries in your code, use UTgetInterrupt()). The render code return value determines how to proceed: ROP_ABORT_RENDER (stop rendering now), ROP_CONTINUE_RENDER (go onto the next frame) or ROP_RETRY_RENDER (redo this frame again). endRender() is called when all the frames are finished, allowing you to cleanup and free any resources. After that, ROPs are fairly similar to other OPs - you'll want to evaluate your parms & determine what to write out. I know this is a bit vague, but there's really no restrictions on what you can do inside a ROP renderFrame() method, so it's a little hard to tell you what to do next. Quote Link to comment Share on other sites More sharing options...
BrianK Posted February 26, 2005 Author Share Posted February 26, 2005 The model for a ROP is fairly simple; it uses 3 basic methods: ... yeah, I gleaned that much from the toolkit html docs. My question was more what happens outside of these three functions. From what you're saying it sounds like I can use one of my SOPs as a template & just add defintions for these three funcs? Is it really that simple? Quote Link to comment Share on other sites More sharing options...
malexander Posted February 26, 2005 Share Posted February 26, 2005 Yep, there's nothing too magical about ROPs All the sequencing work is done by ROP_Node, so all you really need to do fill in the blanks (startRender/renderFrame/endRender) to output your data. The only other thing you may want is the Render button/Frame Range controls. You can build that into your own template list using the fragment: void newDriverOperator(OP_OperatorTable *table) { OP_VariablePair *vp = new OP_VariablePair(ROP_Node::myVariableList); OP_TemplatePair *tp1 = new OP_TemplatePair(ROP_MyDriver::myTemplateList); OP_TemplatePair *tp = new OP_TemplatePair(ROP_Node::getROPbaseTemplate(), tp1); table->addOperator(new OP_Operator("mydriver", "MyDriver", ROP_MyDriver::myConstructor, tp, 0, 0, vp, OP_FLAG_GENERATOR)); } (please excuse any type-os) 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.