13 #ifndef __HOM_Module_h__
14 #define __HOM_Module_h__
35 #include <hboost/any.hpp>
38 class STORUI_OrboltURLHandler;
155 #define HOM_SESSION_MODULE_NAME "hou.session"
156 #define HOM_SESSION_MODULE_CPIO_NAME "." HOM_SESSION_MODULE_NAME
167 static void setHOMCreator(
void (*homCreator)());
171 virtual std::vector<std::string> _getArgumentAutoComplete(
172 const char *method_name,
const char *arguments,
173 bool meta_info_only =
false) = 0;
178 virtual void setRelativeNodeForAutoComplete(
OP_Node *node) = 0;
184 virtual bool isUIAvailable() = 0;
185 virtual bool _isCurrentThreadHoldingHOMLock() = 0;
208 virtual bool _assertWrapper(
209 const char *file,
int linenum,
const char *
function,
210 const char *
condition,
const char *reason) = 0;
212 virtual void exit(
int exit_code=0,
bool suppress_save_prompt=
false) = 0;
217 virtual bool isExiting() = 0;
219 virtual void addPreloadIcon(
const char *
name,
int w,
int h) = 0;
220 virtual void rasterizePreloadIcons() = 0;
223 virtual std::vector<int> applicationVersion(
bool include_patch=
false) = 0;
224 virtual std::string applicationVersionString() = 0;
225 virtual std::string applicationCompilationDate() = 0;
228 virtual bool isApprentice() = 0;
229 virtual void releaseLicense() = 0;
232 virtual int maxThreads() = 0;
233 virtual void setMaxThreads(
int max_threads) = 0;
240 virtual void setPwd(
HOM_Node &newpwd) = 0;
241 virtual void cd(
const char *
path) = 0;
247 virtual HOM_Node* currentDopNet() = 0;
248 virtual void setCurrentDopNet(
HOM_Node &dopnet) = 0;
251 virtual bool simulationEnabled() = 0;
252 virtual void setSimulationEnabled(
bool enabled) = 0;
259 virtual std::vector<HOM_ElemPtr<HOM_Node> > nodes(
const std::vector<std::string> &
paths) = 0;
260 virtual std::vector<HOM_ElemPtr<HOM_NetworkMovableItem> > items(
const std::vector<std::string> &
paths) = 0;
262 virtual HOM_Node *nodeBySessionId(
int session_id) = 0;
263 virtual HOM_NetworkBox *networkBoxBySessionId(
int session_id) = 0;
264 virtual HOM_StickyNote *stickyNoteBySessionId(
int session_id) = 0;
266 int64 session_id) = 0;
267 virtual HOM_NetworkDot *networkDotBySessionId(
int session_id) = 0;
271 int node_session_id,
int input_index) = 0;
278 virtual std::vector<HOM_ElemPtr<HOM_Node> > selectedNodes(
279 bool include_hidden =
false) = 0;
280 virtual std::vector<HOM_ElemPtr<HOM_NetworkMovableItem> > selectedItems(
281 bool include_hidden =
false) = 0;
282 virtual std::vector<HOM_ElemPtr<HOM_NodeConnection> > selectedConnections() = 0;
283 virtual void clearAllSelected() = 0;
286 virtual void copyNodesToClipboard(
const std::vector<HOM_Node *> &nodes) = 0;
287 virtual void pasteNodesFromClipboard(
HOM_Node &destination_node) = 0;
293 virtual HOM_Parm* newParm(
OP_Node &node,
int parm_index,
int vector_index) = 0;
295 virtual HOM_Parm *evaluatingParm() = 0;
301 virtual std::vector< std::map<std::string, std::string> >
302 parmClipboardContents() = 0;
335 virtual std::map<std::string, HOM_NodeTypeCategory *>
336 nodeTypeCategories() = 0;
338 virtual std::vector<HOM_ElemPtr<HOM_Node> > copyNodesTo(
339 const std::vector<HOM_Node *> &nodes,
341 virtual std::vector<HOM_ElemPtr<HOM_Node> > moveNodesTo(
342 const std::vector<HOM_Node *> &nodes,
346 virtual std::vector<HOM_ElemPtr<HOM_NodeBundle> > nodeBundles() = 0;
347 virtual std::vector<HOM_ElemPtr<HOM_NodeBundle> > selectedNodeBundles() = 0;
352 const char *file_path) = 0;
355 virtual fpreal getTimeWithoutAddingDependency() = 0;
356 virtual double time() = 0;
357 virtual void setTime(
double time) = 0;
358 virtual double frame() = 0;
359 virtual int intFrame() = 0;
360 virtual void setFrame(
double frame) = 0;
361 virtual double fps() = 0;
362 virtual void setFps(
double fps) = 0;
363 virtual double timeToFrame(
double time) = 0;
364 virtual double frameToTime(
double frame) = 0;
369 virtual void _syncFromMainContext() = 0;
370 virtual void _syncToMainContext() = 0;
373 virtual fpreal scaleFromMKS(
const char *
units) = 0;
376 virtual double bezier() = 0;
377 virtual double constant() = 0;
378 virtual double cubic() = 0;
379 virtual double cycle(
double start_frame,
double end_frame) = 0;
380 virtual double cyclet(
double start_time,
double end_time) = 0;
381 virtual double cycleoffset(
double start_frame,
double end_frame) = 0;
382 virtual double cycleoffsett(
double start_time,
double end_time) = 0;
383 virtual double ease() = 0;
384 virtual double easein() = 0;
385 virtual double easeinp(
double ease_speed) = 0;
386 virtual double easeout() = 0;
387 virtual double easeoutp(
double ease_speed) = 0;
388 virtual double easep(
double ease_bias) = 0;
389 virtual double linear() = 0;
390 virtual double match() = 0;
391 virtual double matchin() = 0;
392 virtual double matchout() = 0;
393 virtual double qlinear() = 0;
394 virtual double quintic() = 0;
395 virtual double repeat(
double start_frame,
double end_frame) = 0;
396 virtual double repeatt(
double start_time,
double end_time) = 0;
397 virtual double spline() = 0;
398 virtual double vmatch() = 0;
399 virtual double vmatchin() = 0;
400 virtual double vmatchout() = 0;
402 virtual std::string chopExportConflictResolutionPattern() = 0;
403 virtual void setChopExportConflictResolutionPattern(
const char *
pattern) = 0;
405 virtual std::vector<HOM_ElemPtr<HOM_VexContext> >
415 virtual std::string hscriptCommandHelp(
const char *command_name) = 0;
419 virtual std::vector<std::string> hscript(
const char *command) = 0;
422 virtual bool almostEqual(
double x,
double y) = 0;
424 virtual std::vector<std::pair<HOM_ElemPtr<HOM_Parm>,
std::string> >
426 const char *project_dir_variable=
"HIP",
bool include_all_refs=
true) = 0;
429 virtual std::string findFile(
const char *file_name) = 0;
430 virtual std::vector<std::string> findFiles(
431 const char *file_name) = 0;
432 virtual std::vector<std::string> findFilesWithExtension(
433 const char *file_extension,
const char *subdirectory = NULL) = 0;
436 virtual std::string findDirectory(
const char *directory_name) = 0;
437 virtual std::vector<std::string> findDirectories(
438 const char *directory_name) = 0;
440 virtual std::vector<std::string> houdiniPath(
const char *pathvar =
nullptr) = 0;
444 #if defined(USE_PYTHON3)
451 virtual std::map<std::string, HOM_BinaryString> loadIndexDataFromString(
454 virtual std::map<std::string, HOM_BinaryString> loadIndexDataFromFile(
455 const char *file_path) = 0;
457 #if PY_VERSION_HEX >= 0x03000000
459 const std::map<std::string, HOM_BinaryString> &index_data) = 0;
461 virtual void saveIndexDataToFile(
462 const char *file_path,
463 const std::map<std::string, HOM_BinaryString> &index_data) = 0;
466 const std::map<std::string, std::string> &index_data) = 0;
468 virtual void saveIndexDataToFile(
469 const char *file_path,
470 const std::map<std::string, std::string> &index_data) = 0;
475 virtual std::vector<std::pair<std::string, HOM_BinaryString> >
476 loadCPIODataFromString(
const char *
data,
int length) = 0;
478 #if PY_VERSION_HEX >= 0x03000000
480 const std::vector<std::pair<std::string, HOM_BinaryString> >
484 const std::vector<std::pair<std::string, std::string> > &
data) = 0;
493 virtual void forceUpdateFromSessionModuleSource() = 0;
494 virtual void forceSetSessionModuleSource(
const char *
source) = 0;
496 virtual void setSessionModuleSource(
const char *
source) = 0;
497 virtual void appendSessionModuleSource(
const char *
source) = 0;
500 virtual int sessionModuleSourceChangeCount() = 0;
506 {
return theImplementation != NULL; }
515 virtual std::vector<std::string>
516 sortedNodePaths(
const std::vector<std::string> &
paths) = 0;
519 virtual std::vector<HOM_ElemPtr<HOM_Node> >
520 sortedNodes(
const std::vector<HOM_Node*> &nodes) = 0;
523 virtual int patternMatch(
524 const char *
pattern,
const char *str,
525 bool ignore_case =
false,
526 bool path_match =
false) = 0;
530 virtual hboost::any hscriptExpression(
const char *expression) = 0;
531 virtual double hscriptFloatExpression(
const char *expression) = 0;
532 virtual std::string hscriptStringExpression(
const char *expression) = 0;
533 virtual std::vector<double>hscriptVectorExpression(
534 const char *expression) = 0;
535 virtual std::vector<std::vector<double> > hscriptMatrixExpression(
536 const char *expression) = 0;
540 virtual char *
getenv(
const char *
name,
const char *default_value=NULL) = 0;
542 virtual void putenv(
const char *
name,
const char *
value) = 0;
544 virtual void unsetenv(
const char *
name) = 0;
546 virtual void allowEnvironmentToOverwriteVariable(
547 const char *
name,
bool onoff) = 0;
549 virtual void *expressionGlobals() = 0;
554 virtual bool updateProgressAndCheckForInterrupt(
int percentage=-1) = 0;
556 virtual std::map<std::string, hboost::any> runVex(
557 const char *vex_file,
558 const std::map<std::string, hboost::any> &inputs,
563 virtual void saveImageDataToFile(
564 const std::vector<float> &color_and_alpha_data,
566 const char *file_name) = 0;
568 virtual void saveImageDataToFile(
571 const char *file_name) = 0;
574 const char *image_file_name,
577 virtual std::vector<int> imageResolution(
const char *image_file_name) = 0;
590 virtual void *opaqueRunCallbackAndCatchCrashes(
void *opaque_callback) = 0;
596 virtual void pushAccessPrivilege(
const char *key) = 0;
597 virtual void popAccessPrivilege(
const char *key) = 0;
601 virtual void registerAccessPrivilegePyClient(
void *opaque_python_object) = 0;
611 const std::vector<double> &default_value,
613 bool min_is_strict,
bool max_is_strict,
616 const char *disable_when,
618 bool is_label_hidden,
621 const char *script_callback,
623 const std::map<std::string, std::string> &tags,
624 const std::map<HOM_EnumValue *, std::string> &conditionals,
625 const std::vector<std::string> &default_expression,
626 const std::vector<HOM_EnumValue *> &default_expression_language) = 0;
632 const std::vector<int> &default_value,
634 bool min_is_strict,
bool max_is_strict,
636 const std::vector<std::string> &menu_items,
637 const std::vector<std::string> &menu_labels,
638 const std::vector<std::string> &icon_names,
643 const char *disable_when,
645 bool is_label_hidden,
648 const char *script_callback,
650 const std::map<std::string, std::string> &tags,
651 const std::map<HOM_EnumValue *, std::string> &conditionals,
652 const std::vector<std::string> &default_expression,
653 const std::vector<HOM_EnumValue *> &default_expression_language) = 0;
659 const std::vector<std::string> &default_value,
663 const std::vector<std::string> &menu_items,
664 const std::vector<std::string> &menu_labels,
665 const std::vector<std::string> &icon_names,
669 const char *disable_when,
671 bool is_label_hidden,
674 const char *script_callback,
676 const std::map<std::string, std::string> &tags,
677 const std::map<HOM_EnumValue *, std::string> &conditionals,
678 const std::vector<std::string> &default_expression,
679 const std::vector<HOM_EnumValue *> &default_expression_language) = 0;
688 const char *disable_when,
690 bool is_label_hidden,
693 const char *script_callback,
695 const std::map<std::string, std::string> &tags,
696 const std::map<HOM_EnumValue *, std::string> &conditionals,
697 const std::vector<std::string> &default_expression,
698 const std::vector<HOM_EnumValue *> &default_expression_language) = 0;
704 const char *disable_when,
706 bool is_label_hidden,
709 const char *script_callback,
711 const std::map<std::string, std::string> &tags,
712 const std::map<HOM_EnumValue *, std::string> &conditionals,
719 const std::vector<std::string> &menu_items,
720 const std::vector<std::string> &menu_labels,
722 const std::vector<std::string> &icon_names,
727 const char *disable_when,
729 bool is_label_hidden,
732 const char *script_callback,
734 const std::map<std::string, std::string> &tags,
735 const std::map<HOM_EnumValue *, std::string> &conditionals,
738 bool store_default_value_as_string,
739 bool is_button_strip,
740 bool strip_uses_icons
746 const char *disable_when,
748 bool is_label_hidden,
751 const char *script_callback,
753 const std::map<std::string, std::string> &tags,
754 const std::map<HOM_EnumValue *, std::string> &conditionals ) = 0;
759 const std::vector<std::string> &column_labels,
761 bool is_label_hidden,
764 const std::map<std::string, std::string> &tags,
765 const std::map<HOM_EnumValue *, std::string> &conditionals) = 0;
770 const std::map<std::string, std::string> &tags,
771 const std::map<HOM_EnumValue *, std::string> &conditionals) = 0;
775 const std::vector<std::string> &folder_names,
777 const std::map<std::string, std::string> &tags) = 0;
782 const std::vector<HOM_ParmTemplate *> &parm_templates,
787 const char *script_callback,
789 const std::map<std::string, std::string> &tags,
790 const std::map<HOM_EnumValue *, std::string> &conditionals,
791 const std::map<HOM_EnumValue *, std::string> &tab_conditionals) = 0;
801 const char *disable_when,
804 const char *script_callback,
806 const std::map<std::string, std::string> &tags,
807 const std::map<HOM_EnumValue *, std::string> &conditionals,
812 const std::vector<HOM_ParmTemplate *> &parm_templates) = 0;
815 bool cook_stats,
bool pdg_cook_stats,
bool solve_stats,
816 bool draw_stats,
bool gpu_draw_stats,
bool viewport_stats,
817 bool script_stats,
bool render_stats,
bool thread_stats,
818 bool frame_stats,
bool memory_stats,
bool errors,
819 bool pane_stats) = 0;
840 const char *operation_name,
const char *long_operation_name,
841 bool open_interrupt_dialog) = 0;
854 const std::vector<HOM_EnumValue *> &selection_types,
857 const std::vector<HOM_Prim *> &prims) = 0;
859 const std::vector<HOM_Point *> &
points) = 0;
861 const std::vector<HOM_Vertex *> &vertices) = 0;
863 const std::vector<HOM_Edge *> &edges) = 0;
867 bool clone_data_ids =
false) = 0;
880 bool keep_external_ref,
bool delay_load) = 0;
891 const char *
name) = 0;
893 virtual HOM_AgentRig *newAgentRig(
const char *
path,
bool keep_external_ref) = 0;
896 const char *
name,
const std::vector<std::string> &transform_names,
897 const std::vector<std::vector<int>> &hierarchy) = 0;
901 bool keep_external_ref =
true) = 0;
904 const char *
name,
const std::vector<int> &transforms,
906 const std::vector<int> &
channels) = 0;
912 const char *
path,
bool keep_external_ref) = 0;
916 bool deforming,
double bounds_scale) = 0;
921 double bounds_scale) = 0;
924 newAgentShapeDeformer(
const char *
name) = 0;
927 newAgentShapeDeformer(
const HOM_EnumValue &deformer_type) = 0;
932 const std::vector<HOM_AgentShapeBinding *> &shape_bindings,
938 bool keep_external_ref =
true) = 0;
942 bool keep_external_ref =
true) = 0;
944 const std::map<std::string, hboost::any> &
data) = 0;
946 virtual bool compareNode(
const char *
path,
const char *dest = NULL) = 0;
947 virtual bool compareNodeBackup(
const char *
path,
int index,
948 const char *dest = NULL) = 0;
949 virtual bool compareHDA(
const char *path_left,
const char *path_right,
950 const char *dest = NULL) = 0;
951 virtual bool compareHDABackup(
const char *
path,
int index,
952 const char *dest = NULL) = 0;
953 virtual bool compareHip(
const char *dest = NULL) = 0;
954 virtual bool compareHipBackup(
int index,
const char *dest = NULL) = 0;
956 virtual bool hasContextOption(
const char *opt) = 0;
958 virtual std::vector<std::string> contextOptionNames() = 0;
959 virtual void setContextOption(
const char *opt,
const char *
value) =0;
960 virtual void setContextOption(
const char *opt,
double value) = 0;
961 virtual void removeContextOption(
const char *opt) = 0;
962 virtual std::string contextOptionConfig(
const char *opt) = 0;
963 virtual void setContextOptionConfig(
const char *opt,
964 const char *config) = 0;
966 SWIGOUT(%ignore addOpaqueContextOptionChangeCallback;)
967 virtual void addOpaqueContextOptionChangeCallback(
void *callback) = 0;
968 SWIGOUT(%ignore removeOpaqueContextOptionChangeCallback;)
969 virtual void removeOpaqueContextOptionChangeCallback(
void *callback) = 0;
974 virtual void setOrboltURLHandler(
975 STORUI_OrboltURLHandler &orbolt_url_handler) = 0;
981 virtual void constructObject(
void *
pointer,
const std::type_info &
type) = 0;
982 virtual void destructObject(
void *
pointer,
const std::type_info &
type) = 0;
983 virtual std::map<std::string, int> objectCounts() = 0;
986 virtual std::vector<std::string> getPreferenceNames() = 0;
988 virtual bool setPreference(
const char *
name,
const char*
value) = 0;
989 virtual bool addPreference(
const char *
name,
const char*
value) = 0;
990 virtual bool removePreference(
const char *
name) = 0;
996 std::vector<HOM_NodeTypeCategory*>
const & contexts) = 0;
1001 std::vector<HOM_NodeTypeCategory*>
const &
categories) = 0;
1023 std::map<std::string, hboost::any>
const &
params,
1031 std::map<std::string, hboost::any>
const &
params,
1038 virtual void startHoudiniEngineDebugger(
unsigned short port) = 0;
1039 virtual void startHoudiniEngineDebugger(
const char *pipe_name) = 0;
1046 bool from_blosc_compression,
1048 bool to_blosc_compression) = 0;
1051 const std::map<
std::string, std::vector<HOM_Keyframe *>> &keyframe_map,
1052 bool binary =
true,
bool use_blosc_compression =
true) = 0;
1055 bool blosc_compressed =
true) = 0;
1057 virtual std::vector<HOM_ElemPtr<HOM_Node> > _nodesFromOPNodeList(
int64 val) = 0;
1058 virtual std::vector<HOM_ElemPtr<HOM_DopData> >
1075 virtual bool removeAnimationLayer(
HOM_Node &layermixer,
const std::string &layername,
bool merge=
false) = 0;
1079 static void (*theHOMCreator)();
1085 friend class HOMF_Module;
1086 static void setImplementation(
HOM_Module* implementation);
1099 template <
typename T>
1122 if (!HOM_theHOMLock)
1204 #define HOM_CONSTRUCT_OBJECT(pointer) \
1205 HOM().constructObject(pointer, typeid(*pointer));
1206 #define HOM_DESTRUCT_OBJECT(pointer) \
1207 HOM().destructObject(pointer, typeid(*pointer));
1209 #define HOM_CONSTRUCT_OBJECT(pointer)
1210 #define HOM_DESTRUCT_OBJECT(pointer)
1228 #endif //__HOM_Module_h__
vint4 max(const vint4 &a, const vint4 &b)
OIIO_API string_view getenv(string_view name)
GLuint const GLchar * name
GLclampf GLclampf GLclampf alpha
#define SYS_VISIBILITY_EXPORT
UT_TaskRootLock & HOMgetLock()
GLint GLint GLint GLint GLint GLint GLsizei width
GLuint GLenum GLenum transform
GT_API const UT_StringHolder time
GLuint const GLfloat * val
GLint GLint GLint GLint GLint GLint GLsizei GLsizei height
UT_UniquePtr< T > HOMdel(T *hom_object)
GLsizei GLsizei GLchar * source
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
UT_TaskLockT< false > UT_TaskRootLock
GLsizei GLenum * categories
HOM_API UT_TaskRootLock * HOM_theHOMLock
bool any(const vbool4 &v)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLint GLsizei const void * data
const GLuint GLenum const void * binary
GLubyte GLubyte GLubyte GLubyte w
GLuint GLsizei GLsizei * length
GLfloat GLfloat GLfloat GLfloat h
GLuint GLuint GLsizei GLenum type
GLuint GLsizei GLsizei GLchar * label
std::map< HOM_EnumValue *, std::string > HOM_StdMapEnumString
GLsizei const GLchar *const * path
GLsizei const GLchar *const * string
SYS_VISIBILITY_EXPORT void HOMextendLibrary()
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER T clip(const T &p, const Box< T > &box)
std::string OIIO_API repeat(string_view str, int n)
Repeat a string formed by concatenating str n times.
GLenum GLsizei const GLuint GLboolean enabled
GLsizei const void * pointer
GLuint GLdouble GLdouble GLint GLint const GLdouble * points
virtual bool readFile(GA_Detail &g, const char *filename, const GA_LoadOptions *opts, UT_StringArray *errors) const
Class which defines an I/O interface to save/load geometry.
SYS_VISIBILITY_EXPORT void newHandle(BM_ResourceManager *m)
Quat< T > spline(const Quat< T > &q0, const Quat< T > &q1, const Quat< T > &q2, const Quat< T > &q3, T t)
vint4 min(const vint4 &a, const vint4 &b)
HOM_API HOM_Module & HOM()
GLenum GLint GLint * precision
GLsizei const GLfloat * value
static bool isImplementationSet()
std::map< std::string, std::string > HOM_StdMapStringString
UT_UniquePtr< UT_OptionEntry > UT_OptionEntryPtr
ImageBuf OIIO_API channels(const ImageBuf &src, int nchannels, cspan< int > channelorder, cspan< float > channelvalues={}, cspan< std::string > newchannelnames={}, bool shuffle_channel_names=false, int nthreads=0)
GLenum const void * paths