15 #ifndef __HOM_Module_h__
16 #define __HOM_Module_h__
37 #include <hboost/any.hpp>
40 class STORUI_OrboltURLHandler;
162 #define HOM_SESSION_MODULE_NAME "hou.session"
163 #define HOM_SESSION_MODULE_CPIO_NAME "." HOM_SESSION_MODULE_NAME
174 static void setHOMCreator(
void (*homCreator)());
178 virtual std::vector<std::string> _getArgumentAutoComplete(
179 const char *method_name,
const char *arguments,
180 bool meta_info_only =
false) = 0;
185 virtual void setRelativeNodeForAutoComplete(
OP_Node *node) = 0;
191 virtual bool isUIAvailable() = 0;
192 virtual bool _isExperimentalActive() = 0;
193 virtual bool _isCurrentThreadHoldingHOMLock() = 0;
216 virtual bool _assertWrapper(
217 const char *file,
int linenum,
const char *
function,
218 const char *
condition,
const char *reason) = 0;
220 virtual void exit(
int exit_code=0,
bool suppress_save_prompt=
false) = 0;
225 virtual bool isExiting() = 0;
227 virtual void addPreloadIcon(
const char *
name,
int w,
int h) = 0;
228 virtual void rasterizePreloadIcons() = 0;
231 virtual std::vector<int> applicationVersion(
bool include_patch=
false) = 0;
232 virtual std::string applicationVersionString() = 0;
233 virtual std::string applicationCompilationDate() = 0;
235 virtual std::map<std::string, std::string> vdbVersionInfo() = 0;
236 virtual int hdkAPIVersion() = 0;
238 virtual bool isApprentice() = 0;
239 virtual void releaseLicense() = 0;
242 virtual int maxThreads() = 0;
243 virtual void setMaxThreads(
int max_threads) = 0;
250 virtual void setPwd(
HOM_Node &newpwd) = 0;
251 virtual void cd(
const char *
path) = 0;
257 virtual HOM_Node* currentDopNet() = 0;
258 virtual void setCurrentDopNet(
HOM_Node &dopnet) = 0;
261 virtual bool simulationEnabled() = 0;
262 virtual void setSimulationEnabled(
bool enabled) = 0;
269 virtual std::vector<HOM_ElemPtr<HOM_Node> > nodes(
const std::vector<std::string> &
paths) = 0;
270 virtual std::vector<HOM_ElemPtr<HOM_NetworkMovableItem> > items(
const std::vector<std::string> &
paths) = 0;
272 virtual HOM_Node *nodeBySessionId(
int session_id) = 0;
273 virtual HOM_NetworkBox *networkBoxBySessionId(
int session_id) = 0;
274 virtual HOM_StickyNote *stickyNoteBySessionId(
int session_id) = 0;
276 int64 session_id) = 0;
277 virtual HOM_NetworkDot *networkDotBySessionId(
int session_id) = 0;
281 int node_session_id,
int input_index) = 0;
288 virtual std::vector<HOM_ElemPtr<HOM_Node> > selectedNodes(
289 bool include_hidden =
false) = 0;
290 virtual std::vector<HOM_ElemPtr<HOM_NetworkMovableItem> > selectedItems(
291 bool include_hidden =
false) = 0;
292 virtual std::vector<HOM_ElemPtr<HOM_NodeConnection> > selectedConnections() = 0;
293 virtual void clearAllSelected() = 0;
296 virtual void copyNodesToClipboard(
const std::vector<HOM_Node *> &nodes) = 0;
297 virtual void pasteNodesFromClipboard(
HOM_Node &destination_node) = 0;
303 virtual HOM_Parm* newParm(
OP_Node &node,
int parm_index,
int vector_index) = 0;
305 virtual HOM_Parm *evaluatingParm() = 0;
311 virtual std::vector< std::map<std::string, std::string> >
312 parmClipboardContents() = 0;
345 virtual std::map<std::string, HOM_NodeTypeCategory *>
346 nodeTypeCategories() = 0;
348 virtual std::vector<HOM_ElemPtr<HOM_Node> > copyNodesTo(
349 const std::vector<HOM_Node *> &nodes,
351 virtual std::vector<HOM_ElemPtr<HOM_Node> > moveNodesTo(
352 const std::vector<HOM_Node *> &nodes,
356 virtual std::vector<HOM_ElemPtr<HOM_NodeBundle> > nodeBundles() = 0;
357 virtual std::vector<HOM_ElemPtr<HOM_NodeBundle> > selectedNodeBundles() = 0;
362 const char *file_path) = 0;
365 virtual fpreal getTimeWithoutAddingDependency() = 0;
366 virtual double time() = 0;
367 virtual void setTime(
double time) = 0;
368 virtual double frame() = 0;
369 virtual int intFrame() = 0;
370 virtual void setFrame(
double frame) = 0;
371 virtual double fps() = 0;
374 bool modify_frame_count =
true,
375 bool preserve_keyframes =
false,
376 bool preserve_frame_start =
false)
378 virtual double timeToFrame(
double time) = 0;
379 virtual double frameToTime(
double frame) = 0;
384 virtual void _syncFromMainContext() = 0;
385 virtual void _syncToMainContext() = 0;
388 virtual fpreal scaleFromMKS(
const char *
units) = 0;
391 virtual double bezier() = 0;
392 virtual double constant() = 0;
393 virtual double cubic() = 0;
394 virtual double cycle(
double start_frame,
double end_frame) = 0;
395 virtual double cyclet(
double start_time,
double end_time) = 0;
396 virtual double cycleoffset(
double start_frame,
double end_frame) = 0;
397 virtual double cycleoffsett(
double start_time,
double end_time) = 0;
398 virtual double ease() = 0;
399 virtual double easein() = 0;
400 virtual double easeinp(
double ease_speed) = 0;
401 virtual double easeout() = 0;
402 virtual double easeoutp(
double ease_speed) = 0;
403 virtual double easep(
double ease_bias) = 0;
404 virtual double linear() = 0;
405 virtual double match() = 0;
406 virtual double matchin() = 0;
407 virtual double matchout() = 0;
408 virtual double qlinear() = 0;
409 virtual double quintic() = 0;
410 virtual double repeat(
double start_frame,
double end_frame) = 0;
411 virtual double repeatt(
double start_time,
double end_time) = 0;
412 virtual double spline() = 0;
413 virtual double vmatch() = 0;
414 virtual double vmatchin() = 0;
415 virtual double vmatchout() = 0;
417 virtual std::string chopExportConflictResolutionPattern() = 0;
418 virtual void setChopExportConflictResolutionPattern(
const char *
pattern) = 0;
420 virtual std::vector<HOM_ElemPtr<HOM_VexContext> >
430 virtual std::string hscriptCommandHelp(
const char *command_name) = 0;
434 virtual std::vector<std::string> hscript(
const char *command) = 0;
437 virtual bool almostEqual(
double x,
double y) = 0;
439 virtual std::vector<std::pair<HOM_ElemPtr<HOM_Parm>,
std::string> >
441 const char *project_dir_variable=
"HIP",
bool include_all_refs=
true) = 0;
444 virtual std::string findFile(
const char *file_name) = 0;
445 virtual std::vector<std::string> findFiles(
446 const char *file_name) = 0;
447 virtual std::vector<std::string> findFilesWithExtension(
448 const char *file_extension,
const char *subdirectory = NULL) = 0;
451 virtual std::string findDirectory(
const char *directory_name) = 0;
452 virtual std::vector<std::string> findDirectories(
453 const char *directory_name) = 0;
455 virtual std::vector<std::string> houdiniPath(
const char *pathvar =
nullptr) = 0;
459 #if defined(USE_PYTHON3)
466 virtual std::map<std::string, HOM_BinaryString> loadIndexDataFromString(
469 virtual std::map<std::string, HOM_BinaryString> loadIndexDataFromFile(
470 const char *file_path) = 0;
472 #if defined(USE_PYTHON3)
474 const std::map<std::string, HOM_BinaryString> &index_data) = 0;
476 virtual void saveIndexDataToFile(
477 const char *file_path,
478 const std::map<std::string, HOM_BinaryString> &index_data) = 0;
481 const std::map<std::string, std::string> &index_data) = 0;
483 virtual void saveIndexDataToFile(
484 const char *file_path,
485 const std::map<std::string, std::string> &index_data) = 0;
490 virtual std::vector<std::pair<std::string, HOM_BinaryString> >
491 loadCPIODataFromString(
const char *
data,
int length) = 0;
493 #if defined(USE_PYTHON3)
495 const std::vector<std::pair<std::string, HOM_BinaryString> >
499 const std::vector<std::pair<std::string, std::string> > &
data) = 0;
508 virtual void forceUpdateFromSessionModuleSource() = 0;
509 virtual void forceSetSessionModuleSource(
const char *
source) = 0;
511 virtual void setSessionModuleSource(
const char *
source) = 0;
512 virtual void appendSessionModuleSource(
const char *
source) = 0;
515 virtual int sessionModuleSourceChangeCount() = 0;
521 {
return theImplementation != NULL; }
530 virtual std::vector<std::string>
531 sortedNodePaths(
const std::vector<std::string> &
paths) = 0;
534 virtual std::vector<HOM_ElemPtr<HOM_Node> >
535 sortedNodes(
const std::vector<HOM_Node*> &nodes) = 0;
538 virtual int patternMatch(
539 const char *
pattern,
const char *str,
540 bool ignore_case =
false,
541 bool path_match =
false) = 0;
545 virtual hboost::any hscriptExpression(
const char *expression) = 0;
546 virtual double hscriptFloatExpression(
const char *expression) = 0;
547 virtual std::string hscriptStringExpression(
const char *expression) = 0;
548 virtual std::vector<double>hscriptVectorExpression(
549 const char *expression) = 0;
550 virtual std::vector<std::vector<double> > hscriptMatrixExpression(
551 const char *expression) = 0;
555 virtual char *
getenv(
const char *
name,
const char *default_value=NULL) = 0;
557 virtual void putenv(
const char *
name,
const char *
value) = 0;
559 virtual void unsetenv(
const char *
name) = 0;
561 virtual void allowEnvironmentToOverwriteVariable(
562 const char *
name,
bool onoff) = 0;
564 virtual void *expressionGlobals() = 0;
569 virtual bool updateProgressAndCheckForInterrupt(
int percentage=-1) = 0;
571 virtual std::map<std::string, hboost::any> runVex(
572 const char *vex_file,
573 const std::map<std::string, hboost::any> &inputs,
578 virtual void saveImageDataToFile(
579 const std::vector<float> &color_and_alpha_data,
581 const char *file_name) = 0;
583 virtual void saveImageDataToFile(
586 const char *file_name) = 0;
589 const char *image_file_name,
592 virtual std::vector<int> imageResolution(
const char *image_file_name) = 0;
605 virtual void *opaqueRunCallbackAndCatchCrashes(
void *opaque_callback) = 0;
611 virtual void pushAccessPrivilege(
const char *key) = 0;
612 virtual void popAccessPrivilege(
const char *key) = 0;
616 virtual void registerAccessPrivilegePyClient(
void *opaque_python_object) = 0;
626 const std::vector<double> &default_value,
628 bool min_is_strict,
bool max_is_strict,
631 const char *disable_when,
633 bool is_label_hidden,
636 const char *script_callback,
638 const std::map<std::string, std::string> &tags,
639 const std::map<HOM_EnumValue *, std::string> &conditionals,
640 const std::vector<std::string> &default_expression,
641 const std::vector<HOM_EnumValue *> &default_expression_language) = 0;
647 const std::vector<int> &default_value,
649 bool min_is_strict,
bool max_is_strict,
652 const std::vector<std::string> &menu_items,
653 const std::vector<std::string> &menu_labels,
654 const std::vector<std::string> &icon_names,
659 const char *disable_when,
661 bool is_label_hidden,
664 const char *script_callback,
666 const std::map<std::string, std::string> &tags,
667 const std::map<HOM_EnumValue *, std::string> &conditionals,
668 const std::vector<std::string> &default_expression,
669 const std::vector<HOM_EnumValue *> &default_expression_language) = 0;
675 const std::vector<std::string> &default_value,
679 const std::vector<std::string> &menu_items,
680 const std::vector<std::string> &menu_labels,
681 const std::vector<std::string> &icon_names,
685 const char *disable_when,
687 bool is_label_hidden,
690 const char *script_callback,
692 const std::map<std::string, std::string> &tags,
693 const std::map<HOM_EnumValue *, std::string> &conditionals,
694 const std::vector<std::string> &default_expression,
695 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,
713 const std::vector<std::string> &default_expression,
714 const std::vector<HOM_EnumValue *> &default_expression_language) = 0;
720 const char *disable_when,
722 bool is_label_hidden,
725 const char *script_callback,
727 const std::map<std::string, std::string> &tags,
728 const std::map<HOM_EnumValue *, std::string> &conditionals,
735 const std::vector<std::string> &menu_items,
736 const std::vector<std::string> &menu_labels,
738 const std::vector<std::string> &icon_names,
743 const char *disable_when,
745 bool is_label_hidden,
748 const char *script_callback,
750 const std::map<std::string, std::string> &tags,
751 const std::map<HOM_EnumValue *, std::string> &conditionals,
754 bool store_default_value_as_string,
755 bool is_button_strip,
756 bool strip_uses_icons
762 const char *disable_when,
764 bool is_label_hidden,
767 const char *script_callback,
769 const std::map<std::string, std::string> &tags,
770 const std::map<HOM_EnumValue *, std::string> &conditionals ) = 0;
775 const std::vector<std::string> &column_labels,
778 bool is_label_hidden,
781 const std::map<std::string, std::string> &tags,
782 const std::map<HOM_EnumValue *, std::string> &conditionals) = 0;
787 const std::map<std::string, std::string> &tags,
788 const std::map<HOM_EnumValue *, std::string> &conditionals) = 0;
792 const std::vector<std::string> &folder_names,
794 const std::map<std::string, std::string> &tags) = 0;
799 const std::vector<HOM_ParmTemplate *> &parm_templates,
804 const char *script_callback,
806 const std::map<std::string, std::string> &tags,
807 const std::map<HOM_EnumValue *, std::string> &conditionals,
808 const std::map<HOM_EnumValue *, std::string> &tab_conditionals) = 0;
818 const char *disable_when,
821 const char *script_callback,
823 const std::map<std::string, std::string> &tags,
824 const std::map<HOM_EnumValue *, std::string> &conditionals,
829 const std::vector<HOM_ParmTemplate *> &parm_templates) = 0;
832 bool cook_stats,
bool pdg_cook_stats,
bool solve_stats,
833 bool draw_stats,
bool gpu_draw_stats,
bool viewport_stats,
834 bool script_stats,
bool render_stats,
bool thread_stats,
835 bool frame_stats,
bool memory_stats,
bool errors,
836 bool pane_stats) = 0;
855 const char *
pattern =
nullptr) = 0;
858 const char *operation_name,
const char *long_operation_name,
859 bool open_interrupt_dialog) = 0;
872 const std::vector<HOM_EnumValue *> &selection_types,
875 const std::vector<HOM_Prim *> &prims) = 0;
877 const std::vector<HOM_Point *> &
points) = 0;
879 const std::vector<HOM_Vertex *> &vertices) = 0;
881 const std::vector<HOM_Edge *> &edges) = 0;
885 bool clone_data_ids =
false) = 0;
898 bool keep_external_ref,
bool delay_load) = 0;
909 const char *
name) = 0;
911 virtual HOM_AgentRig *newAgentRig(
const char *
path,
bool keep_external_ref) = 0;
914 const char *
name,
const std::vector<std::string> &transform_names,
915 const std::vector<std::vector<int>> &hierarchy) = 0;
919 bool keep_external_ref =
true) = 0;
922 const char *
name,
const std::vector<int> &transforms,
924 const std::vector<int> &
channels) = 0;
930 const char *
path,
bool keep_external_ref) = 0;
934 bool deforming,
double bounds_scale) = 0;
942 newAgentShapeDeformer(
const char *
name) = 0;
945 newAgentShapeDeformer(
const HOM_EnumValue &deformer_type) = 0;
950 const std::vector<HOM_AgentShapeBinding *> &shape_bindings,
956 bool keep_external_ref =
true) = 0;
960 bool keep_external_ref =
true) = 0;
962 const std::map<std::string, hboost::any> &
data) = 0;
964 virtual bool compareNode(
const char *
path,
const char *dest = NULL) = 0;
965 virtual bool compareNodeBackup(
const char *
path,
int index,
966 const char *dest = NULL) = 0;
967 virtual bool compareHDA(
const char *path_left,
const char *path_right,
968 const char *dest = NULL) = 0;
969 virtual bool compareHDABackup(
const char *
path,
int index,
970 const char *dest = NULL) = 0;
971 virtual bool compareHip(
const char *dest = NULL) = 0;
972 virtual bool compareHipBackup(
int index,
const char *dest = NULL) = 0;
974 virtual bool hasContextOption(
const char *opt) = 0;
976 virtual std::vector<std::string> contextOptionNames() = 0;
977 virtual void setContextOption(
const char *opt,
const char *
value) =0;
978 virtual void setContextOption(
const char *opt,
double value) = 0;
979 virtual void removeContextOption(
const char *opt) = 0;
980 virtual std::string contextOptionConfig(
const char *opt) = 0;
981 virtual void setContextOptionConfig(
const char *opt,
982 const char *config) = 0;
983 virtual bool isAutoContextOption(
const char *opt) = 0;
984 virtual bool isAutoContextOptionOverridden(
const char *opt) = 0;
986 SWIGOUT(%ignore addOpaqueContextOptionChangeCallback;)
987 virtual void addOpaqueContextOptionChangeCallback(
void *callback) = 0;
988 SWIGOUT(%ignore removeOpaqueContextOptionChangeCallback;)
989 virtual void removeOpaqueContextOptionChangeCallback(
void *callback) = 0;
990 virtual void removeAllContextOptionChangeCallbacks() = 0;
991 SWIGOUT(%ignore opaqueContextOptionChangeCallbacks;)
992 virtual std::vector<void *> opaqueContextOptionChangeCallbacks() = 0;
997 virtual void setOrboltURLHandler(
998 STORUI_OrboltURLHandler &orbolt_url_handler) = 0;
1004 virtual void constructObject(
void *
pointer,
const std::type_info &
type) = 0;
1005 virtual void destructObject(
void *
pointer,
const std::type_info &
type) = 0;
1006 virtual std::map<std::string, int> objectCounts() = 0;
1009 virtual std::vector<std::string> getPreferenceNames() = 0;
1011 virtual bool setPreference(
const char *
name,
const char*
value) = 0;
1012 virtual bool addPreference(
const char *
name,
const char*
value) = 0;
1013 virtual bool removePreference(
const char *
name) = 0;
1019 std::vector<HOM_NodeTypeCategory*>
const & contexts) = 0;
1024 std::vector<HOM_NodeTypeCategory*>
const &
categories) = 0;
1046 std::map<std::string, hboost::any>
const &
params,
1054 std::map<std::string, hboost::any>
const &
params,
1061 virtual void startHoudiniEngineDebugger(
unsigned short port) = 0;
1062 virtual void startHoudiniEngineDebugger(
const char *pipe_name) = 0;
1072 bool from_blosc_compression,
1074 bool to_blosc_compression) = 0;
1077 const std::map<
std::string, std::vector<HOM_Keyframe *>> &keyframe_map,
1078 bool binary =
true,
bool use_blosc_compression =
true) = 0;
1081 bool blosc_compressed =
true) = 0;
1083 virtual std::vector<HOM_ElemPtr<HOM_Node> > _nodesFromOPNodeList(
int64 val) = 0;
1084 virtual std::vector<HOM_ElemPtr<HOM_DopData> >
1101 virtual bool removeAnimationLayer(
HOM_Node &layermixer,
const std::string &layername,
bool merge=
false) = 0;
1104 virtual void* _sceneViewerWindow(
int64 val) = 0;
1107 static void (*theHOMCreator)();
1113 friend class HOMF_Module;
1114 static void setImplementation(
HOM_Module* implementation);
1127 template <
typename T>
1150 if (!HOM_theHOMLock)
1248 #define HOM_CONSTRUCT_OBJECT(pointer) \
1249 HOM().constructObject(pointer, typeid(*pointer));
1250 #define HOM_DESTRUCT_OBJECT(pointer) \
1251 HOM().destructObject(pointer, typeid(*pointer));
1253 #define HOM_CONSTRUCT_OBJECT(pointer)
1254 #define HOM_DESTRUCT_OBJECT(pointer)
1272 #endif //__HOM_Module_h__
GLsizei GLenum * categories
#define SYS_VISIBILITY_EXPORT
UT_TaskRootLock & HOMgetLock()
GT_API const UT_StringHolder time
const GLuint GLenum const void * binary
GLsizei const GLchar *const * path
UT_UniquePtr< T > HOMdel(T *hom_object)
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat< T > spline(const Quat< T > &q0, const Quat< T > &q1, const Quat< T > &q2, const Quat< T > &q3, T t) IMATH_NOEXCEPT
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLuint const GLchar * name
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
GLubyte GLubyte GLubyte GLubyte w
GLuint GLenum GLenum transform
UT_TaskLockT< false > UT_TaskRootLock
HOM_API UT_TaskRootLock * HOM_theHOMLock
bool any(const vbool4 &v)
GLsizei GLsizei GLchar * source
GLsizei const GLchar *const * string
GLuint GLsizei const GLchar * label
GLint GLsizei GLsizei height
GLuint GLdouble GLdouble GLint GLint const GLdouble * points
GLenum GLint GLint * precision
std::map< HOM_EnumValue *, std::string > HOM_StdMapEnumString
std::string OIIO_UTIL_API repeat(string_view str, int n)
Repeat a string formed by concatenating str n times.
GLuint GLsizei GLsizei * length
OIIO_API string_view getenv(string_view name, string_view defaultval)
GLfloat GLfloat GLfloat GLfloat h
SYS_VISIBILITY_EXPORT void HOMextendLibrary()
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
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.
GLenum const GLfloat * params
SYS_VISIBILITY_EXPORT void newHandle(BM_ResourceManager *m)
GLfloat GLfloat GLfloat alpha
HOM_API HOM_Module & HOM()
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T clip(const T &p, const Box< T > &box) IMATH_NOEXCEPT
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