16 #ifndef __OP_Director_h__
17 #define __OP_Director_h__
38 #define OP_POSTLOAD_SCRIPT "456.cmd"
43 class OP_SaveCallback;
46 class op_ShopClerkInfo;
55 class OP_EventScriptPathCache;
58 void *
data,
void *cbdata);
83 typedef OP_ERROR (*SaveCallback)(std::ostream &,
void *);
100 std::ostream &,
OP_Context &,
int = 0)
override
103 const char * =
nullptr)
override
119 bool loadChannelManagerOptions();
120 bool saveChannelManagerOptions();
124 bool include_temporary=
false);
130 bool remove_existing =
true);
132 virtual void enable(
int state);
134 OP_ERROR saveNetwork(std::ostream &os,
137 const char *merge_pattern=
nullptr,
139 void initializeManagerWireStyles();
140 virtual void clearNetwork(
int clear_aliases );
145 virtual void opUpdateAllExports();
148 { myOldCHOPOverrideFlag =
true; }
150 {
return myOldCHOPOverrideFlag; }
152 { myOldCHOPOverrideFlag =
false; }
165 int eval_collection=-1);
175 return myCwdContext.getValueForThread(thread)
182 bool include_hidden=
false,
183 bool append_to_list=
false)
const;
185 bool include_hidden=
false)
const;
186 bool getPickedInputs(
191 void clearPickedItems();
203 void addPickedNode(
const OP_Node &node,
bool edit);
204 void removePickedNode(
const OP_Node &node,
bool edit);
205 void makePickedNodeLast(
const OP_Node &node,
bool edit);
222 void addPickedInput(
const OP_Input &input);
223 void removePickedInput(
const OP_Input &input);
230 void setNFrames(
fpreal nframes,
bool notify =
true);
232 void setChopMotionSamples(
int n,
bool notify =
true);
245 void setSamplesPerSec(
247 bool modify_frame_count =
true,
248 bool preserve_keyframes =
false,
249 bool preserve_frame_start =
false,
255 void setGlobalTime(
fpreal t_start,
fpreal t_end,
bool notify =
true);
260 void setTimeRange(
fpreal t_start,
fpreal t_end,
bool notify =
true);
265 void setSampleRange(
fpreal frame_start,
fpreal fend,
bool notify =
true);
273 void setSaveCallback(SaveCallback cb,
void *cb_data);
274 void removeSaveCallback(SaveCallback cb,
void *cb_data);
278 void addEventCallback(EventType
type, EventCallback cb,
280 void removeEventCallback(EventType
type, EventCallback cb,
284 void setUserDisplayOptionSaveCallback(
285 OP_ERROR (*cb)(std::ostream &,
void *),
286 void *callback_data);
287 void setSceneFileVisualizersSaveCallback(
288 OP_ERROR (*cb)(std::ostream &,
void *),
289 void *callback_data);
290 void addBadLoadData(
char *str,
int len);
293 virtual void beginLoading();
294 virtual void endLoading();
296 {
return myIsLoadingHip; }
298 {
return myIsQuitting; }
300 { myIsDoingExplicitSave =
value; }
302 {
return myIsDoingExplicitSave; }
303 const OP_Node *getAnyCookingNode()
const;
306 {
return myIsMantra; }
310 {
return myIsClearing; }
312 void destroyFileResolver();
314 void beginTakeSwitch();
315 void endTakeSwitch();
317 {
return mySwitchingTake; }
323 void saveChannelGroups(std::ostream &os,
int binary);
325 void saveTimeGroups(std::ostream &os,
int binary);
327 void saveBookmarks(std::ostream &os,
int binary);
329 void saveScriptedOpLibrary(std::ostream &os);
330 bool loadScriptedOpLibrary(
UT_IStream &is, time_t modtime);
332 void saveInternalOpLibraries(std::ostream &os);
334 void saveLibraryPreferences(std::ostream &os);
336 bool loadHOMSessionModuleSource(
UT_IStream &is);
337 void saveUnselectedFilePatterns(std::ostream &os);
338 bool loadUnselectedFilePatterns(
UT_IStream &is);
343 void saveExprFunctions(std::ostream &os);
350 {
return myCookEnabled; }
352 { myCookEnabled = state; }
356 {
return mySimulationEnabled; }
358 { mySimulationEnabled = state; }
363 {
return mySkipPlaybarBasedSimulationReset > 0; }
365 { mySkipPlaybarBasedSimulationReset += inc; }
368 bool addShopClerk(
const char *
type);
370 {
return myShopInfo.entries(); }
371 const char *getShopClerkName(
int clerk)
const;
372 int getShopClerkVisibility(
int clerk)
const;
373 void setShopClerkVisibility(
int clerk,
int onoff);
400 std::ostream &)
const
421 const char *parmname,
454 bool is_source_code =
false)
457 bool is_source_code =
false)
484 static void globAllArgumentsAsArray(
OP_Node &relative_to_node,
504 void getTableAndOperator(
508 const OP_Node *relativetonode =
nullptr);
510 {
return myOTLManager; }
512 {
return myOTLManager; }
517 void runDeleteScriptsOnQuit();
521 void addGlobalOpChangedCallback(
523 void removeGlobalOpChangedCallback(
528 void globalOpChanged(
OP_Node *node,
536 static bool createBackupFile(
const char *
filename,
542 static void autoIncrementRename(
const char *
filename,
553 const char *startup_script,
554 const char *postload_script);
558 {
return myGlobalEventScriptPathCache; }
561 void clearGlobalEventScriptPathCache();
564 void getCachedGlobalEventScriptPaths(
567 bool only_nonempty)
const;
573 bool getSaveSceneAsText()
const;
574 void setSaveSceneAsText(
bool on_off);
575 bool getNewFileSaveSceneAsText()
const;
576 void setNewFileSaveSceneAsText(
bool on_off);
580 void notifyBeforeSceneSave(
586 void notifyAfterSceneSave(
594 {
return myOrientationMode; }
596 { myOrientationMode = axis; }
598 static UT_Obfuscator *getObfuscator();
606 {
return binary ?
".bhip" :
".hip"; }
607 void clearUnsupportedCommands()
const;
618 errors +=
"Spare parameters are not alowed on ";
619 errors +=
"the root node.";
625 void runPostLoadScript();
633 void installCommands();
634 void installMoreCommands();
635 void installCHCommands();
636 void installOTLCommands();
637 void installOpRampResolver();
639 void savePreCommands(std::ostream &os);
640 void savePostCommands(std::ostream &os);
642 void notifyEventCallbacks(EventType
type);
646 void updateNewDefinition(
651 void varChanged(
const UT_String &varname);
657 static void getFirstFoundStartupScriptFile(
659 const char *script_file_name);
666 static void getFirstFoundScriptFile(
668 const char *inputpath);
674 int myBadLoadDataLen;
681 CwdContext() : myCwdId(-1)
693 OP_SaveCallback *myCallbacks;
694 OP_SaveCallback *myUserDisplayOptionCallback;
695 OP_SaveCallback *mySceneFileVisualizersCallback;
703 int mySimulationEnabled;
704 int mySkipPlaybarBasedSimulationReset;
714 struct EventCallbackInfo
718 friend bool operator==(
const EventCallbackInfo &lhs,
const EventCallbackInfo &rhs)
720 return (lhs.cb == rhs.cb) && (lhs.data == rhs.data);
733 EventCallbackInfoList myEventCallbacks[NUM_NETWORK_EVENT_TYPES];
736 OP_EventScriptPathCache *myGlobalEventScriptPathCache;
738 OrientationMode myOrientationMode;
743 bool myOldCHOPOverrideFlag;
748 bool mySwitchingTake;
752 bool myIsDoingExplicitSave;
763 bool mySaveSceneAsText;
764 bool myNewFileSaveSceneAsText;
769 bool myRunningPostLoadScript =
false;
771 static UT_Obfuscator *theObfuscator;
virtual bool addNodeSpareParm(OP_Parameters *, PRM_Template *) const
bool loadNetwork(UT_IStream &is, int merge=0, const char *pattern=NULL, int overwrite=0, const OP_FixNameParms *fix_name_parms=NULL, UT_StringArray *src_names=NULL, UT_StringArray *dest_names=NULL)
UT_ErrorSeverity OP_ERROR
UT_ValArray< OP_GlobalOpChangedCallback > OP_GlobalOpChangedCallbacks
GT_API const UT_StringHolder filename
OP_StyleManager * getStyleManager()
void setIsDoingExplicitSave(bool value)
OP_API OP_Director * OPsetDirector(OP_Director *boss)
GT_API const UT_StringHolder time
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
UT_ColorTable & getGroupColorTable()
bool isSwitchingTake() const
GLsizei const GLfloat * value
void setOldCHOPOverrideFlag()
const GLuint GLenum const void * binary
bool getOldCHOPOverrideFlag()
GLsizei const GLchar *const * path
virtual void findInternalScriptOperators(const char *, OP_OTLDefinitionArray &)
virtual bool loadNodeSpareParms(OP_Parameters *, UT_IStream &, UT_String &) const
int saveCookedData(const char *, OP_Context &) override
virtual void definitionsRemoved(int, UT_IntArray &, OP_OTLLibrary *&)
std::tuple< Types...> UT_Tuple
OP_EventScriptPathCache * getGlobalEventScriptPathCache()
OP_BundleList * getBundles()
**But if you need a result
bool changeSpareParms(UT_IStream &, UT_String &errors) override
virtual int renameNode(OP_Node *node, const char *name, OP_RenameAction action=OP_RENAME_NORMAL)
virtual void clearHandleSettings(OP_Operator *)
virtual void deleteAllNodeSpareParms(OP_Parameters *) const
OrientationMode getOrientationMode() const
void setOrientationMode(OrientationMode axis)
int saveCookedData(std::ostream &, OP_Context &, int=0) override
static void saveOTLBackupInformation(std::ostream &os, const OP_OperatorList &fallbackops, const OP_OperatorList &dummyops)
CH_Manager * getChannelManager()
OP_OTLManager & getOTLManager()
const char * getOpType() const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
virtual void updateExportedParms(OP_Node *)
OP_OpTypeId getOpTypeID() const override
virtual bool loadNodeCompiledDs(OP_Node *, UT_IStream &)
OP_DataType getCookedDataType() const override
virtual bool loadNodeCompiledCode(OP_Node *, UT_IStream &, bool is_source_code=false)
int getCwdStackSize(int thread) const
OP_ERROR cookMe(OP_Context &) override
bool getIsDoingExplicitSave() const
void bumpSkipPlaybarBasedSimulationReset(int inc)
void clearOldCHOPOverrideFlag()
bool getIsQuitting() const
int getNShopClerks() const
bool getIsLoadingHip() const
void getPickedItems(OP_ItemTypeMask item_type_mask, OP_NetworkBoxItemList &picked, bool include_hidden=false, bool recurse_picked_netboxes=false) const
void deleteCookedData() override
const char * getChildType() const override
virtual OP_ERROR saveNodeSpareParms(OP_Parameters *, bool, std::ostream &) const
GLuint const GLchar * name
virtual bool removeNodeSpareParm(OP_Parameters *node, const char *parmname, UT_StringArray *errs=nullptr, UT_StringArray *warn=nullptr) const
GLenum GLenum GLsizei void * table
virtual OP_Node * linkInternalScriptOperator(const char *, OP_Operator *)
GT_API const UT_StringHolder version
const OP_OTLManager & getOTLManager() const
virtual void getInternalScriptDefinition(OP_Node *, UT_String &)
virtual void deleteNodeSpareParmLayout(OP_Parameters *) const
unsigned int OP_ItemTypeMask
fpreal32 getVersion() 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
Create an evaluation context scope with a new node.
virtual void addExtraInput(OP_Node *op, OP_InterestType type)
OP_Take * getTakeManager()
const char * getFileExtension(int binary) const override
virtual void saveNodeSpareParmCommands(OP_Parameters *, std::ostream &, const char *, bool) const
OP_API OP_Director * OPgetDirector()
bool loadCookedData(UT_IStream &, const char *=nullptr) override
virtual void saveNodeCompiledDs(OP_Node *, std::ostream &)
OP_CommandManager * getCommandManager()
**If you just want to fire and args
void getCwd(UT_String &str)
virtual PRM_ScriptPage * allocateSpareScriptPage(OP_Operator *)
void setCookEnabled(int state)
virtual void definitionsAdded(int, UT_IntArray &)
virtual void saveNodeCompiledCode(OP_Node *, std::ostream &, bool is_source_code=false)
virtual void changeNodeSpareParms(OP_Parameters *, PI_EditScriptedParms &, UT_String &) const
int simulationEnabled() const
OP_ERROR bypassMe(OP_Context &, int &) override
void * getCookedData(const OP_Context &) override
Cooks node data and makes it available through the reader.
OP_OpTypeId getChildTypeID() const override
void setSimulationEnabled(int state)
void(* OP_GlobalOpChangedCallback)(OP_Node *node, OP_EventType reason, void *data, void *cbdata)
UT_NonCopyable & operator=(const UT_NonCopyable &)=delete
bool getIsClearing() const
bool skipPlaybarBasedSimulationReset() const