12 #ifndef __ROP_Node_h__
13 #define __ROP_Node_h__
29 class ROP_ExecuteContext;
97 #define FLT_PARM(name, vi, t) \
98 { return evalFloat(name, vi, t); }
99 #define FLT_SET(name, vi, t, val) \
100 { setFloat(name, vi, t, val); }
101 #define INT_SET(name, vi, t, val) \
102 { setInt(name, vi, t, val); }
104 #define INT_PARM(name, vi, t) \
105 { return evalInt(name, vi, t); }
107 #define INT_SET(name, vi, t, val) \
108 { setInt(name, vi, t, val); }
110 #define STR_PARM(name, vi, t) \
111 { evalString(str, name, vi, t); }
115 class ROP_SohoOutput;
141 virtual ROP_IFD *castToROPIFD();
142 virtual ROP_IFDBase *castToROPIFDBase();
143 virtual ROP_SohoOp *castToROPSoho();
144 virtual ROP_OpenGL *castToROPOpenGL();
146 virtual bool hasImageOutput();
149 virtual bool detectIfExistingOutputFiles();
151 virtual void deleteExistingOutputFiles();
163 static void initSimulationOPs();
176 const char *relative_path = NULL)
override;
182 ROP_SohoOutput *out=0,
183 bool generate=
false);
199 { myExecuteOverride =
f;
200 myExecuteOverrideData = d;
203 { myPreExecuteOverride =
f;
204 myPreExecuteOverrideData = d;
207 { myPostExecuteOverride =
f;
208 myPostExecuteOverrideData = d;
228 void setRenderResX(
int x);
229 void setRenderResY(
int y);
232 void setRenderAspect(
float aspect);
233 float getRenderAspect();
239 {
INT_SET(
"trange", 0, 0, val) }
242 if(myOverrideFrameRangeFlag)
245 return myCachedDoRange;
250 if(myOverrideFrameRangeFlag)
251 return myOverrideStartFrame;
253 return myCachedStart;
257 if(myOverrideFrameRangeFlag)
258 return myOverrideEndFrame;
265 if(myOverrideFrameRangeFlag)
266 return myOverrideFrameInc;
270 virtual bool SETROPCOOK();
273 static int doRenderCback(
void *
data,
int index,
277 static int doRenderBackgroundCback(
void *
data,
int index,
280 static int doRenderDialog(
void *
data,
int index,
290 bool executePreRenderScript(
fpreal ttime);
291 bool executePreFrameScript(
fpreal ttime);
292 bool executePostFrameScript(
fpreal ttime);
293 bool executePostWriteScript(
fpreal ttime);
294 bool executePostRenderScript(
fpreal ttime);
295 bool executeIPRStopScript(
fpreal ttime);
297 static void buildRibVersionMenu(
PRM_Name *menu,
int max,
298 bool for_archive=
false);
312 virtual void initRenderDependencies();
313 virtual void cleanupRenderDependencies();
315 void addJobFrames(
const char *job_name,
316 const char *frame_string);
318 static void setDependencyRenderFlag(
bool f);
319 static bool getDependencyRenderFlag();
321 static void setFrameByFrameFlag(
bool f);
322 static bool getFrameByFrameFlag();
324 static void setRenderScriptFlag(
bool enable);
325 static bool getRenderScriptFlag();
327 static void setOutputResolutionScale(
fpreal xscale,
fpreal yscale);
328 static void getOutputResolutionScale(
float &xs,
float &ys);
331 { x = y = 0;
return false; }
335 static void setRenderQuality(
int quality);
336 int getRenderQuality();
339 void overrideFrameRange(
bool enable,
346 {
return myOverrideOutputFlag; }
350 virtual void overrideOutput(
bool enable,
const char *fname=0);
354 bool getOutputOverride(
357 bool expand =
true)
const;
367 bool getOutputOverrideEx(
370 const char *output_parm_name,
371 const char *mkdir_parm_name);
373 virtual void overrideDevice(
bool enable,
bool interactive=
false,
374 const char *devicestr=0);
376 bool expand =
true)
const;
394 { myForceBackgroundRender =
f; }
396 {
return myForceBackgroundRender; }
400 { myTemporaryInputs = in; }
418 {
return myLastRenderItem; }
422 virtual bool isRenderDependentOnNode(
ROP_Node *node,
427 void addRenderEventCallback(
430 bool run_before_script);
433 void removeRenderEventCallback(
437 static void setColorCorrectionIPGamma(
bool enable,
fpreal gamma);
438 static fpreal getColorCorrectionIPGamma();
439 static void setColorCorrectionIPLUT(
bool enable,
const char *lut);
440 static const char *getColorCorrectionIPLUT();
442 static void setColorCorrectionEnvVariables(
bool set);
443 static void setFPSVariable(
bool do_set = 0,
fpreal frame_inc = 1);
455 int &copied_input)
override;
477 virtual int startRender(
int nframes,
fpreal tstart,
484 TAKE_Take *applyRenderTake(
const char *take);
485 void restorePreviousTake(
TAKE_Take *take);
487 void initRenderDependencyVars(
fpreal t);
488 virtual void doInitRenderDependencyVars(
fpreal t);
492 virtual void buildInputRenderDependencies(
495 bool matchingLastRenderParms(
498 { myLastRenderItem = item; }
499 void clearLastRenderDep();
512 {
INT_SET(
"trange", 0, 0, val); }
531 {
return myVerbose; }
533 {
return myVerbose.getStream(); }
535 {
return myVerbose.getAlfred(); }
564 {
return myTemporaryInputs.entries(); }
567 {
return myTemporaryInputs(i); }
586 struct EventCallbackEntry
590 bool myRunBeforeScript;
595 static void resetSimulation(
OP_Node* node);
597 ROP_ExecuteContext *myEContext;
600 void *myExecuteOverrideData;
602 void *myPreExecuteOverrideData;
604 void *myPostExecuteOverrideData;
606 bool myForceBackgroundRender;
608 bool myOverrideFrameRangeFlag;
609 fpreal myOverrideStartFrame;
610 fpreal myOverrideEndFrame;
611 fpreal myOverrideFrameInc;
613 bool myOverrideOutputFlag;
616 bool myOverrideDeviceFlag;
626 bool executeCallback(
fpreal ttime,
629 bool executeParmScript(
const char *parm_name,
632 bool executeParmScripts(
const char *parm_name,
639 static void installCommands();
652 myFullFrameInc(0.0
f),
657 myIgnoreBypass(true),
658 myIgnoreLocks(false),
663 myFirstFrameFlag(true) { }
682 { myFullStart =
start; myFullEnd =
end; myFullFrameInc = finc; }
684 { myStart =
start; myEnd =
end; myFrameInc = finc; }
696 fpreal finc = myFullFrameInc;
723 myIgnoreBypass = ignore_bypass;
724 myIgnoreLocks = ignore_locks;
731 { myRenderSerial = render_serial; }
736 { myDepParent = dep_parent; }
747 myOrder = copy.myOrder;
748 myDepParent = copy.myDepParent;
749 myTopLevelRop = copy.myTopLevelRop;
750 myFullStart = copy.myFullStart;
751 myFullEnd = copy.myFullEnd;
752 myFullFrameInc = copy.myFullFrameInc;
753 myStart = copy.myStart;
755 myFrameInc = copy.myFrameInc;
756 myRenderSerial = copy.myRenderSerial;
757 myDoInputs = copy.myDoInputs;
758 myIgnoreBypass = copy.myIgnoreBypass;
759 myIgnoreLocks = copy.myIgnoreLocks;
760 myFrameMerge = copy.myFrameMerge;
761 myFirstFrameFlag = copy.myFirstFrameFlag;
766 return (myFullStart == copy.myFullStart &&
767 myFullEnd == copy.myFullEnd &&
768 myFullFrameInc == copy.myFullFrameInc &&
769 myStart == copy.myStart &&
770 myEnd == copy.myEnd &&
771 myFrameInc == copy.myFrameInc &&
772 myDoInputs == copy.myDoInputs &&
773 myIgnoreBypass == copy.myIgnoreBypass &&
774 myIgnoreLocks == copy.myIgnoreLocks &&
775 myFrameMerge == copy.myFrameMerge &&
776 myRenderSerial == copy.myRenderSerial);
794 bool myFirstFrameFlag;
virtual int saveCookedData(std::ostream &os, OP_Context &, int binary=0)=0
bool isOutputOverridden() const
fpreal getFullFrameInc() const
virtual bool updateParmsFlags()
void setDepParent(const ROP_RenderItemHandle &dep_parent)
void setOrder(ROP_RenderList &order)
static const char * theChildTableName
fpreal getH() const override
Node position/scale is used by the UI.
virtual void getOutputFile(UT_String &)
fpreal getW() const override
Node position/scale is used by the UI.
void addMessage(int code, const char *msg=0)
virtual void FSTART_SET(fpreal val)
void setFullFrameRange(fpreal start, fpreal end, fpreal finc)
#define SYS_VISIBILITY_EXPORT
virtual void FINC_SET(fpreal val)
GT_API const UT_StringHolder time
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
virtual void FEND_SET(fpreal val)
const GLuint GLenum const void * binary
void setExecuteOverride(ROP_ExecuteOverride f, void *d)
GLsizei const GLchar *const * path
void addSystemError(const char *msg=0)
bool isFirstFrame() const
Parameters for OP_Node::getInfoText()/OP_Node::getNodeSpecificInfoText()
OP_VERSION myCachedVersion
bool evalVariableValue(UT_String &v, int index, int thread) override
ROP_RenderItemHandle getLastRenderDepItem() const
**But if you need a result
void clearTemporaryInputs()
virtual void getNodeSpecificInfoText(OP_Context &context, OP_NodeInfoParms &parms)
virtual void SETDORANGE(int val)
virtual OP_ERROR cookMe(OP_Context &context)=0
void setRenderSerial(int render_serial)
fpreal getFullEnd() const
std::ostream * getVerbose() const
void setFirstFrame(bool first)
void setDoInputsFlag(bool do_inputs)
const ROP_RenderDepParms & operator=(const ROP_RenderDepParms ©)
void setLastRenderDepItem(ROP_RenderItemHandle item)
ROP_RenderDepParms(const ROP_RenderDepParms ©)
ROP_RenderMode getRenderMode()
virtual const char * getInteractiveImageDevice() const
virtual void DORANGE_SET(int val)
virtual void RENDER_TAKE(UT_String &take)
void forceBackgroundRender(bool f=true)
ROP_Node * getTopLevelRop() const
void evalString(UT_String &val, int pi, int vi, fpreal t) const
void setFullAscendingFrameRange(ROP_Node &rop)
virtual bool getOutputResolution(int &x, int &y)
bool getForceBackgroundRender() const
void addWarning(int code, const char *msg=0)
#define FLT_SET(name, vi, t, val)
ROP_Node * getTemporaryInputs(int i) const
void copyErrorsInto(UT_ErrorManager &error_manager)
void addError(int code, const char *msg=0)
GLdouble GLdouble GLint GLint order
void(* ROP_ExecuteOverride)(ROP_Node *me, fpreal time, void *data)
#define INT_SET(name, vi, t, val)
virtual bool referenceSingleParameter(OP_Parameters *from, int parm_idx, const char *relative_path=NULL)
GLuint const GLchar * name
fpreal getFrameInc() const
const ROP_RenderItemHandle & getDepParent() const
virtual OP_DataType getCookedDataType() const =0
bool operator==(const ROP_RenderDepParms ©)
GLenum GLenum GLsizei void * table
virtual OP_OpTypeId getOpTypeID() const
int getNumTemporaryInputs() const
void setFrameRange(fpreal start, fpreal end, fpreal finc)
void setTemporaryInputs(const UT_ValArray< ROP_Node * > &in)
void setPreExecuteOverride(ROP_ExecuteOverride f, void *d)
int stealErrors(UT_ErrorManager &victim, int rangestart=0, int rangeend=-1, UT_ErrorSeverity severity=UT_ERROR_NONE, bool borrow_only=false)
fpreal getFullStart() const
virtual const char * getChildType() const
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
void setExecuteContext(ROP_ExecuteContext *c)
bool getIgnoreBypass() const
virtual const char * getFileExtension(int binary) const =0
Parameters for OP_Node::fillInfoTree()/OP_Node::fillInfoTreeNodeSpecific()
void setIgnoreFlags(bool ignore_bypass, bool ignore_locks)
virtual void fillInfoTreeNodeSpecific(UT_InfoTree &tree, const OP_NodeInfoTreeParms &parms)
ROP_RenderList & getOrder() const
void copyErrorsFrom(UT_ErrorManager &error_manager)
File options for manipulating image data on load or save. This class allows you to modify the incomin...
void setFrameMerge(bool merge)
virtual const char * getOpType() const
void(* ROP_RenderButtonCB)(ROP_Node *, ROP_RenderMode)
ROP_ExecuteContext * getExecuteContext()
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
ROP_RenderMode myRenderMode
A global error manager scope.
virtual OP_OpTypeId getChildTypeID() const =0
**If you just want to fire and args
virtual bool evalVariableValue(UT_String &val, int index, int thread)
void setTopLevelRop(ROP_Node *rop)
bool getIgnoreLocks() const
ROP_Verbose & getRopVerbose()
void inputConnectChanged(int which) override
virtual void * getCookedData(const OP_Context &)
bool(* ROP_RenderEventCallback)(ROP_Node *node, ROP_RenderEventType event, fpreal time, void *data)
bool getFrameMerge() const
void setRenderMode(ROP_RenderMode mode)
virtual bool isPreviewAllowed()
Override if preview is supported by rendering to 'ip'.
SYS_VISIBILITY_EXPORT void newDriverOperator(OP_OperatorTable *table)
virtual bool getGeometryHandle(const char *path, fpreal t, GU_DetailHandle &gdh, UT_DMatrix4 &world_xform)
virtual OP_ERROR bypassMe(OP_Context &context, int &copied_input)=0
UT_LockedRawPtr< UT_ErrorManager, OP_Lock > getLockedErrorManager()
void setPostExecuteOverride(ROP_ExecuteOverride f, void *d)
virtual void onCreated()
Overriden in VOPs.
int getRenderSerial() const
virtual void deleteCookedData()=0