HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_Node.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * COMMENTS:
7  */
8 
9 #ifndef __HOM_Node_h__
10 #define __HOM_Node_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_NetworkMovableItem.h"
14 #include "HOM_BinaryString.h"
15 #include "HOM_EnumModules.h"
16 #include "HOM_IterableList.h"
17 #include "HOM_PtrOrNull.h"
18 #include <PY/PY_OpaqueObject.h>
19 #include <string>
20 #include <vector>
21 
22 class HOM_StickyNote;
23 class HOM_NodeConnection;
24 class HOM_NodeGroup;
25 class HOM_NodeType;
27 class HOM_Parm;
28 class HOM_ParmTuple;
29 class HOM_IndirectInput;
31 class HOM_HDAModule;
34 class HOM_ParmTemplate;
35 class HOM_DopSimulation;
36 class HOM_DopObject;
38 class HOM_NodeInfoTree;
39 class CL_Clip;
40 
41 SWIGOUT(%rename(Node) HOM_Node;)
42 
43 class HOM_API HOM_Node : virtual public HOM_NetworkMovableItem
44 {
45 public:
47  : HOM_NetworkMovableItem(HOM_networkItemType::Node)
48  { HOM_CONSTRUCT_OBJECT(this) }
49  HOM_Node(const HOM_Node &node)
51  { HOM_CONSTRUCT_OBJECT(this) }
52  ~HOM_Node() override
53  { HOM_DESTRUCT_OBJECT(this) }
54 
55  virtual std::vector<std::string> _getArgumentAutoComplete(
56  const char *method_name, const char *arguments,
57  bool meta_info_only = false) = 0;
58 
59  int __hash__() override = 0;
60 
61  virtual std::string __repr__() = 0;
62 
63  virtual bool operator==(HOM_PtrOrNull<HOM_Node> node) = 0;
64  virtual bool operator!=(HOM_PtrOrNull<HOM_Node> node) = 0;
65 
66  virtual std::string __str__() = 0;
67 
68  SWIGOUT(%kwargs infoTree;)
69  virtual HOM_NodeInfoTree infoTree(
70  bool verbose = false, bool debug = false, int output_index = 0) = 0;
71  virtual bool isNetwork() = 0;
72 
73  SWIGOUT(%newobject type;)
74  SWIGOUT(%warnfilter(321) type;)
75  virtual HOM_NodeType *type() = 0;
76 
77  virtual HOM_NodeTypeCategory *childTypeCategory() = 0;
78 
79  virtual bool isFlagReadable(HOM_EnumValue &flag) = 0;
80  virtual bool isFlagWritable(HOM_EnumValue &flag) = 0;
81  virtual bool isGenericFlagSet(HOM_EnumValue &flag) = 0;
82  virtual void setGenericFlag(HOM_EnumValue &flag, bool value) = 0;
83 
84  virtual bool isDisplayDescriptiveNameFlagSet() = 0;
85  virtual void setDisplayDescriptiveNameFlag(bool on) = 0;
86  virtual int outputForViewFlag() = 0;
87  virtual void setOutputForViewFlag(int output) = 0;
88 
89  // We need a quick way to get the OP_OpTypeId from C++ code so we know
90  // which subclass of HOM_Node we should cast to, so that's why
91  // opTypeIdAsInt() exists.
92  SWIGOUT(%ignore opTypeIdAsInt;)
93  virtual int opTypeIdAsInt() = 0;
94  // Further, we need a quick way to get the OBJ_OBJECT_TYPE from C++ code
95  // so we know which subclass of HOM_ObjNode we should cast to.
96  // That's why objTypeAsInt() exists.
97  SWIGOUT(%ignore objTypeAsInt;)
98  virtual int objTypeAsInt() = 0;
99 
100  SWIGOUT(%newobject node;)
101  SWIGOUT(%kwargs node;)
102  virtual HOM_Node* node(const char* node_path) = 0;
103 
104  SWIGOUT(%kwargs nodes;)
105  virtual std::vector<HOM_ElemPtr<HOM_Node> > nodes(
106  const std::vector<std::string>& node_paths) = 0;
107 
108  SWIGOUT(%kwargs cookPathNodes;)
109  virtual std::vector<HOM_ElemPtr<HOM_Node> > cookPathNodes() = 0;
110 
111  SWIGOUT(%newobject item;)
112  SWIGOUT(%kwargs item;)
113  virtual HOM_NetworkMovableItem* item(const char* item_path) = 0;
114 
115  SWIGOUT(%kwargs items;)
116  virtual std::vector<HOM_ElemPtr<HOM_NetworkMovableItem> > items(
117  const std::vector<std::string>& item_paths) = 0;
118 
119  SWIGOUT(%kwargs glob;)
120  virtual std::vector<HOM_ElemPtr<HOM_Node> > glob(
121  const char *pattern, bool ignore_case=false) = 0;
122 
123  SWIGOUT(%kwargs recursiveGlob;)
124  virtual std::vector<HOM_ElemPtr<HOM_Node> > recursiveGlob(
125  const char *pattern,
126  HOM_EnumValue &filter = HOM_nodeTypeFilter::NoFilter,
127  bool include_subnets = true) = 0;
128 
129  SWIGOUT(%newobject createNode;)
130  SWIGOUT(%kwargs createNode;)
131  virtual HOM_Node* createNode(
132  const char* node_type_name,
133  const char* node_name=NULL,
134  bool run_init_scripts=true,
135  bool load_contents=true,
136  bool exact_type_name=false,
137  bool force_valid_node_name=false) = 0;
138  virtual void runInitScripts() = 0;
139  virtual void createOrMoveVisualizer(int output_index) = 0;
140 
141  virtual int inputIndex(const char *input_name) = 0;
142  virtual int outputIndex(const char *output_name) = 0;
143 
144  virtual void setInput(
145  int input_index,
146  HOM_NetworkMovableItem *item_to_become_input,
147  int output_index = 0) = 0;
148 
149  virtual void setNamedInput(
150  const char *input_name,
151  HOM_NetworkMovableItem *item_to_become_input,
152  const char *output_name) = 0;
153 
154  virtual void setNamedInput(
155  const char *input_name,
156  HOM_NetworkMovableItem *item_to_become_input,
157  int output_index) = 0;
158 
159  virtual void setFirstInput(
160  HOM_NetworkMovableItem *item_to_become_input,
161  int output_index = 0) = 0;
162 
163  SWIGOUT(%kwargs setNextInput;)
164  virtual void setNextInput(
165  HOM_NetworkMovableItem *item_to_become_input,
166  int output_index = 0,
167  bool unordered_only = false) = 0;
168 
169  virtual void insertInput(
170  int input_index,
171  HOM_NetworkMovableItem *item_to_become_input,
172  int output_index = 0) = 0;
173 
174  virtual int numOrderedInputs() = 0;
175 
176  virtual std::vector<HOM_ElemPtr<HOM_Node> > inputs() = 0;
177 
178  SWIGOUT(%warnfilter(321) input;)
179  virtual HOM_Node *input(int input_index) = 0;
180  virtual HOM_Node *inputFollowingOutputs(int input_index) = 0;
181 
182  virtual std::vector<HOM_ElemPtr<HOM_NodeConnection> > inputConnections() = 0;
183 
184  SWIGOUT(%newobject inputConnectors;)
185  virtual HOM_IterableList<std::vector<HOM_ElemPtr<HOM_NodeConnection> > > *
186  inputConnectors() = 0;
187 
188  SWIGOUT(%kwargs inputAncestors;)
189  virtual std::vector<HOM_ElemPtr<HOM_Node> > inputAncestors(
190  bool include_ref_inputs = true,
191  bool follow_subnets = false,
192  bool only_used_inputs = false) = 0;
193 
194  virtual std::vector<std::string> inputNames() = 0;
195  virtual std::vector<std::string> inputLabels() = 0;
196 
197  virtual std::map<std::string, std::string> editableInputStrings(
198  int input_index) = 0;
199  virtual std::string editableInputString(int input_index,
200  const char *key) = 0;
201  virtual void setEditableInputString(int input_index,
202  const char *key, const char *value) = 0;
203 
204  virtual std::vector<std::string> outputNames() = 0;
205  virtual std::vector<std::string> outputLabels() = 0;
206 
207  virtual std::vector<HOM_ElemPtr<HOM_Node> > outputs() = 0;
208 
209  virtual std::vector<HOM_ElemPtr<HOM_NodeConnection> >
210  outputConnections() = 0;
211 
212  SWIGOUT(%newobject outputConnectors;)
213  virtual HOM_IterableList<std::vector<HOM_ElemPtr<HOM_NodeConnection> > > *
214  outputConnectors() = 0;
215 
216  // Dependency information.
217  SWIGOUT(%kwargs references;)
218  virtual std::vector<HOM_ElemPtr<HOM_Node> >
219  references(bool include_children=true) = 0;
220  SWIGOUT(%kwargs dependents;)
221  virtual std::vector<HOM_ElemPtr<HOM_Node> >
222  dependents(bool include_children=true) = 0;
223 
224  // Access things contained in this node (node must be a network).
225  virtual std::vector<HOM_ElemPtr<HOM_Node> > children() = 0;
226  SWIGOUT(%kwargs allSubChildren;)
227  virtual std::vector<HOM_ElemPtr<HOM_Node> > allSubChildren(
228  bool top_down = true, bool recurse_in_locked_nodes = true) = 0;
229  SWIGOUT(%kwargs selectedChildren;)
230  virtual std::vector<HOM_ElemPtr<HOM_Node> > selectedChildren(
231  bool include_hidden = false,
232  bool include_hidden_support_nodes = false) = 0;
233 
234  virtual std::vector<HOM_ElemPtr<HOM_NetworkMovableItem> > allItems() = 0;
235  SWIGOUT(%kwargs selectedItems;)
236  virtual std::vector<HOM_ElemPtr<HOM_NetworkMovableItem> > selectedItems(
237  bool include_hidden = false,
238  bool include_hidden_support_nodes = false) = 0;
239  SWIGOUT(%kwargs numItems;)
240  virtual int numItems(HOM_EnumValue *item_type = NULL,
241  bool selected_only = false,
242  bool include_hidden = false) = 0;
243 
244  // Picked child item copy/paste/delete methods.
245  SWIGOUT(%kwargs deleteItems;)
246  virtual void deleteItems(
247  const std::vector<HOM_NetworkMovableItem *>&
248  items = std::vector<HOM_NetworkMovableItem *>(),
249  bool disable_safety_checks = false) = 0;
250  virtual void copyItemsToClipboard(
251  const std::vector<HOM_NetworkMovableItem *> &items =
252  std::vector<HOM_NetworkMovableItem *>()) = 0;
253  virtual void pasteItemsFromClipboard(HOM_Vector2 *position = NULL) = 0;
254  SWIGOUT(%kwargs copyItems;)
255  virtual std::vector<HOM_ElemPtr<HOM_NetworkMovableItem> > copyItems(
256  const std::vector<HOM_NetworkMovableItem *> &items,
257  bool channel_reference_originals=false,
258  bool relative_references=true,
259  bool connect_outputs_to_multi_inputs=false) = 0;
260 
261  SWIGOUT(%newobject creator;)
262  virtual HOM_Node *creator() = 0;
263  virtual bool isInsideLockedHDA() = 0;
264  virtual bool isEditableInsideLockedHDA() = 0;
265  virtual bool isEditable() = 0;
266  virtual bool isLockedHDA() = 0;
267  virtual bool isCompiled() = 0;
268  virtual bool isMaterialManager() = 0;
269 
270  SWIGOUT(%newobject hdaModule;)
271  virtual HOM_HDAModule *hdaModule() = 0;
272 
273  SWIGOUT(%newobject hdaViewerStateModule;)
274  virtual HOM_HDAViewerStateModule *hdaViewerStateModule() = 0;
275 
276  SWIGOUT(%newobject hdaViewerHandleModule;)
277  virtual HOM_HDAViewerHandleModule *hdaViewerHandleModule() = 0;
278 
279  // hm is an alias for hdaModule.
280  SWIGOUT(%newobject hm;)
281  virtual HOM_HDAModule *hm()
282  { return hdaModule(); }
283 
284  SWIGOUT(%newobject moveToGoodPosition;)
285  SWIGOUT(%kwargs moveToGoodPosition;)
286  virtual HOM_Vector2 *moveToGoodPosition(bool relative_to_inputs = true,
287  bool move_inputs = true,
288  bool move_outputs = true,
289  bool move_unconnected = true) = 0;
290 
291  // TODO: Have an argument to specify sorting orders once bug 25998 is fixed.
292  // Have an argument equivalent to oplayout -t once bug 26018 is fixed.
293  SWIGOUT(%kwargs layoutChildren);
294  virtual void layoutChildren
295  (const std::vector<HOM_NetworkMovableItem *> &items =
296  std::vector<HOM_NetworkMovableItem *>(),
297  double horizontal_spacing=-1, double vertical_spacing=-1) = 0;
298 
299  virtual bool isCurrent() = 0;
300  SWIGOUT(%kwargs setCurrent;)
301  virtual void setCurrent(bool on, bool clear_all_selected = false) = 0;
302 
303  virtual bool isHidden() = 0;
304  virtual void hide(bool on) = 0;
305 
306  virtual std::string comment() = 0;
307  virtual void setComment(const char *comment) = 0;
308  virtual void appendComment(const char *comment) = 0;
309 
310  virtual std::string creatorState() = 0;
311  virtual void setCreatorState(const char *state) = 0;
312 
313  virtual bool isBuiltExplicitly() = 0;
314  virtual void setBuiltExplicitly(bool built_explicitly) = 0;
315 
316  virtual HOM_EnumValue *expressionLanguage() = 0;
317  virtual void setExpressionLanguage(HOM_EnumValue &language) = 0;
318 
319  SWIGOUT(%newobject parm;)
320  virtual HOM_Parm *parm(const char* parm_path) = 0;
321 
322  SWIGOUT(%newobject parmTuple;)
323  virtual HOM_ParmTuple *parmTuple(const char* parm_path) = 0;
324 
325  SWIGOUT(%kwargs globParms;)
326  virtual std::vector<HOM_ElemPtr<HOM_Parm> > globParms(
327  const char *pattern, bool ignore_case=false,
328  bool search_label=false,
329  bool single_pattern=false) = 0;
330 
331  virtual std::vector<HOM_ElemPtr<HOM_Parm> > parms() = 0;
332 
333  virtual std::vector<HOM_ElemPtr<HOM_Parm> > parmsReferencingThis() = 0;
334 
335  virtual std::vector<HOM_ElemPtr<HOM_ParmTuple> > parmTuples() = 0;
336 
337  virtual std::vector<HOM_ElemPtr<HOM_Parm> > spareParms() = 0;
338  virtual void removeSpareParms() = 0;
339 
340  virtual void syncNodeVersionIfNeeded(const std::string &from_version) = 0;
341 
342  SWIGOUT(%kwargs setParmTemplateGroup;)
343  virtual void setParmTemplateGroup(
344  HOM_ParmTemplateGroup &parm_template_group,
345  bool rename_conflicting_parms=false) = 0;
346 
347 
348  virtual std::vector<HOM_ElemPtr<HOM_ParmTuple> > parmTuplesInFolder(
349  const std::vector<std::string> &folder_names) = 0;
350 
351  virtual std::vector<HOM_ElemPtr<HOM_Parm> > parmsInFolder(
352  const std::vector<std::string> &folder_names) = 0;
353 
354  SWIGOUT(%newobject parmTemplateGroup;)
355  virtual HOM_ParmTemplateGroup *parmTemplateGroup() = 0;
356 
357  virtual std::vector<std::string> localVariables() = 0;
358  virtual std::vector<std::string> localAttributes() = 0;
359 
360  virtual bool isTimeDependent() = 0;
361 
362  SWIGOUT(%kwargs destroy;)
363  virtual void destroy(bool disable_safety_checks=false) = 0;
364 
365  // If propagate==true, unlock will be propagated to ancestors
366  SWIGOUT(%kwargs allowEditingOfContents;)
367  virtual void allowEditingOfContents(bool propagate=false) = 0;
368  virtual void matchCurrentDefinition() = 0;
369  virtual bool matchesCurrentDefinition() = 0;
370 
371  SWIGOUT(%kwargs parmAliases;)
372  virtual std::map<HOM_ElemPtr<HOM_Parm>, std::string>
373  parmAliases(bool recurse=false) = 0;
374 
375  virtual void clearParmAliases() = 0;
376 
377  virtual std::vector<HOM_ElemPtr<HOM_NetworkBox> > networkBoxes() = 0;
378 
379  SWIGOUT(%newobject iterNetworkBoxes;)
380  virtual HOM_IterableList<HOM_NetworkBox> *iterNetworkBoxes() = 0;
381 
382  SWIGOUT(%newobject createNetworkBox;)
383  virtual HOM_NetworkBox *createNetworkBox(const char *name=NULL) = 0;
384 
385  SWIGOUT(%newobject copyNetworkBox;)
386  virtual HOM_NetworkBox *copyNetworkBox(HOM_NetworkBox &network_box_to_copy,
387  const char *new_name=NULL, bool channel_reference_original=false) = 0;
388 
389  SWIGOUT(%newobject findNetworkBox;)
390  virtual HOM_NetworkBox *findNetworkBox(const char *name) = 0;
391 
392  virtual std::vector<HOM_ElemPtr<HOM_NetworkBox> >
393  findNetworkBoxes(const char *pattern) = 0;
394 
395  virtual std::vector<HOM_ElemPtr<HOM_NetworkDot> > networkDots() = 0;
396 
397  SWIGOUT(%newobject createNetworkDot;)
398  virtual HOM_NetworkDot *createNetworkDot() = 0;
399 
400  SWIGOUT(%kwargs changeNodeType);
401  SWIGOUT(%newobject changeNodeType;)
402  virtual HOM_Node *changeNodeType(const char *new_node_type,
403  bool keep_name=true, bool keep_parms=true,
404  bool keep_network_contents=true,
405  bool force_change_on_node_type_match=false) = 0;
406 
407  virtual bool canCreateDigitalAsset() = 0;
408  SWIGOUT(%kwargs createDigitalAsset);
409  SWIGOUT(%newobject createDigitalAsset;)
410  virtual HOM_Node *createDigitalAsset(const char *name=NULL,
411  const char *hda_file_name=NULL, const char *description=NULL,
412  int min_num_inputs=0, int max_num_inputs=0,
413  bool compress_contents=false, const char *comment=NULL,
414  const char *version=NULL, bool save_as_embedded=false,
415  bool ignore_external_references=false,
416  bool compile_asset = false,
417  bool change_node_type = true,
418  bool create_backup = true,
419  const char *install_path=NULL) = 0;
420 
421  SWIGOUT(%kwargs createCompiledDigitalAsset);
422  virtual void createCompiledDigitalAsset(const char *name=NULL,
423  const char *hda_file_name=NULL, const char *description=NULL) = 0;
424 
425  // Sub-Network methods.
426  SWIGOUT(%kwargs collapseIntoSubnet;)
427  SWIGOUT(%newobject collapseIntoSubnet;)
428  virtual HOM_Node *collapseIntoSubnet(
429  const std::vector<HOM_NetworkMovableItem*> &child_items,
430  const char *subnet_name=NULL, const char *subnet_type=NULL) = 0;
431 
432  virtual std::vector<HOM_ElemPtr<HOM_NetworkMovableItem> >
433  extractAndDelete() = 0;
434 
435  virtual std::vector<HOM_ElemPtr<HOM_SubnetIndirectInput> >
436  indirectInputs() = 0;
437 
438  // get the nodes inside a subnet that feed its outputs
439  virtual std::vector<HOM_ElemPtr<HOM_Node> >
440  subnetOutputs() = 0;
441 
442  virtual bool isSubNetwork() = 0;
443 
444  // User data methods:
445  virtual void setUserData(const char *name, const std::string &value) = 0;
446  SWIGOUT(%ignore boostAnyUserData;)
447  virtual hboost::any boostAnyUserData(const char *name) = 0;
448  virtual void destroyUserData(const char *name) = 0;
449  virtual void clearUserDataDict() = 0;
450 #if defined(USE_PYTHON3)
451  virtual std::map<std::string, std::string> userDataDict() = 0;
452 #else
453  virtual std::map<std::string, HOM_BinaryString> userDataDict() = 0;
454 #endif
455 
456  // TOPs work item navigation, these are here
457  // so both TopNode and SopNode (for sop top networks)
458  // can call them
459  virtual void selectNextVisibleWorkItem() = 0;
460  virtual void selectPreviousVisibleWorkItem() = 0;
461  virtual void deselectWorkItem() = 0;
462  virtual void setCurrentTOPPage(int page) = 0;
463 
464 #ifdef SWIG
465 %extend
466 {
467  InterpreterObject userData(const char *name)
468  { return HOMboostAnyToInterpreterObject(self->boostAnyUserData(name)); }
469 }
470 #endif
471 
472 
473  // Cached user data methods:
474  SWIGOUT(%ignore setOpaqueCachedUserData;)
475  virtual void setOpaqueCachedUserData(
476  const char *name, void *opaque_py_object) = 0;
477  SWIGOUT(%ignore opaqueCachedUserData;)
478  virtual void *opaqueCachedUserData(const char *name) = 0;
479  virtual void destroyCachedUserData(const char *name) = 0;
480  virtual void clearCachedUserDataDict() = 0;
481  virtual std::map<std::string, PY_OpaqueObject> cachedUserDataDict() = 0;
482 
483 #ifdef SWIG
484 %extend
485 {
486  void setCachedUserData(const char *name, InterpreterObject value)
487  { return self->setOpaqueCachedUserData(name, value); }
488 
489  InterpreterObject cachedUserData(const char *name)
490  { return HOMincRef((InterpreterObject)self->opaqueCachedUserData(name)); }
491 }
492 #endif
493 
494  // Data Block methods (like user data, but bigger blobs with associated
495  // data types).
496  virtual std::vector<std::string> dataBlockKeys(
497  const char *blocktype = nullptr) = 0;
498  virtual std::string dataBlockType(const char *key) = 0;
499  virtual HOM_BinaryString dataBlock(const char *key) = 0;
500  virtual void setDataBlock(const char *key, HOM_BinaryString data,
501  const char *blocktype) = 0;
502 
503  // asCode methods:
504  SWIGOUT(%kwargs asCode;)
505  virtual std::string asCode(bool brief=false,
506  bool recurse=false,
507  bool save_channels_only=false,
508  bool save_creation_commands=true,
509  bool save_keys_in_frames=false,
510  bool save_outgoing_wires=false,
511  bool save_parm_values_only=false,
512  bool save_spare_parms=true,
513  const char *function_name=NULL) = 0;
514 
515  virtual bool canGenerateCookCode(bool check_parent=false,
516  bool check_auto_shader=true) = 0;
517  SWIGOUT(%newobject cookCodeGeneratorNode;)
518  virtual HOM_Node *cookCodeGeneratorNode() = 0;
519  virtual std::string cookCodeLanguage() = 0;
520  virtual bool supportsMultiCookCodeContexts() = 0;
521 
522 
523  SWIGOUT(%kwargs saveCookCodeToFile;)
524  virtual void saveCookCodeToFile(
525  const char *file_name, bool skip_header=false,
526  const char *context_name = NULL) = 0;
527 
528  // This method is deprecated.
529  void saveCodeToFile(const char *file_name, bool skip_header=false,
530  const char *context_name = NULL)
531  { saveCookCodeToFile(file_name, skip_header, context_name); }
532 
533 
534  virtual void saveCompiledCookCodeToFile(const char *file_name,
535  const char *context_name = NULL) = 0;
536 
537  // This method is deprecated.
538  void saveToCompiledVexFile(const char *file_name,
539  const char *context_name = NULL)
540  { saveCompiledCookCodeToFile(file_name, context_name); }
541 
542 
543  SWIGOUT(%kwargs cook;)
544  virtual void cook(
545  bool force = false,
546  const std::vector<double> frame_range = std::vector<double>()) = 0;
547 
548  SWIGOUT(%kwargs cookNoInterruptInternal;)
549  virtual void _cookNoInterruptInternal(
550  bool force = false,
551  const std::vector<double> frame_range = std::vector<double>()) = 0;
552 
553  /// Determine if this node to cook at the current evaluation time
554  virtual bool needsToCook() = 0;
555  /// Determine if this node to cook at the given time
556  virtual bool needsToCook(double time) = 0;
557 
558  virtual int cookCount() = 0;
559 
560  virtual void updateParmStates() = 0;
561 
562  virtual std::string deleteScript() = 0;
563  virtual void setDeleteScript(const std::string &script_text,
564  HOM_EnumValue &language = HOM_scriptLanguage::Python) = 0;
565 
566  // Sticky methods
567  SWIGOUT(%newobject createStickyNote;)
568  virtual HOM_StickyNote *createStickyNote(const char *name=NULL) = 0;
569 
570  virtual std::vector<HOM_ElemPtr<HOM_StickyNote> > stickyNotes() = 0;
571 
572  SWIGOUT(%newobject iterStickyNotes;)
573  virtual HOM_IterableList<HOM_StickyNote> *iterStickyNotes() = 0;
574 
575  SWIGOUT(%newobject copyStickyNote;)
576  virtual HOM_StickyNote *copyStickyNote(HOM_StickyNote &sticky_note_to_copy,
577  const char *new_name=NULL) = 0;
578 
579  SWIGOUT(%newobject findStickyNote;)
580  virtual HOM_StickyNote *findStickyNote(const char *name) = 0;
581 
582  SWIGOUT(%newobject findStickyNotes;)
583  virtual std::vector<HOM_ElemPtr<HOM_StickyNote> > findStickyNotes(
584  const char *pattern) = 0;
585 
586 
587  SWIGOUT(%newobject addNodeGroup;)
588  virtual HOM_NodeGroup *addNodeGroup(const char *name = NULL) = 0;
589 
590  virtual std::vector<HOM_ElemPtr<HOM_NodeGroup> > nodeGroups() = 0;
591 
592  SWIGOUT(%newobject nodeGroup;)
593  virtual HOM_NodeGroup *nodeGroup(const char *name) = 0;
594 
595  virtual std::vector<std::string> errors() = 0;
596  virtual std::vector<std::string> warnings() = 0;
597  virtual std::vector<std::string> messages() = 0;
598 
599  virtual std::string motionEffectsNetworkPath() = 0;
600  SWIGOUT(%newobject findOrCreateMotionEffectsNetwork;)
601  virtual HOM_Node *findOrCreateMotionEffectsNetwork(bool create=true) = 0;
602 
603  SWIGOUT(%kwargs saveItemsToFile;)
604  virtual void saveItemsToFile(
605  const std::vector<HOM_NetworkMovableItem *> &items,
606  const char *file_name,
607  bool save_hda_fallbacks = false) = 0;
608  SWIGOUT(%kwargs loadItemsFromFile;)
609  virtual void loadItemsFromFile(
610  const char *file_name, bool ignore_load_warnings=false) = 0;
611 
612  SWIGOUT(%ignore addOpaqueEventCallback;)
613  virtual void addOpaqueEventCallback(
614  const std::vector<HOM_EnumValue *> &event_types,
615  void *py_callback) = 0;
616  SWIGOUT(%ignore addOpaqueParmCallback;)
617  virtual void addOpaqueParmCallback(
618  void *py_callback,
619  const std::vector<std::string> &names) = 0;
620  SWIGOUT(%ignore removeOpaqueEventCallback;)
621  virtual void removeOpaqueEventCallback(
622  const std::vector<HOM_EnumValue *> &event_types,
623  void *py_callback) = 0;
624  virtual void removeAllEventCallbacks() = 0;
625  SWIGOUT(%ignore opaqueEventCallbacks;)
626  virtual std::vector<std::pair<std::vector<HOM_EnumValue *>, void *> >
627  opaqueEventCallbacks() = 0;
628 
629  virtual double stampValue(const char *name, double default_value) = 0;
630  virtual std::string stampValue(
631  const char *name, const char *default_value) = 0;
632 
633  virtual void *_asVoidPointer() = 0;
634 
635  SWIGOUT(%newobject simulation;)
636  virtual HOM_DopSimulation *simulation() = 0;
637 
638  virtual std::vector<HOM_ElemPtr<HOM_Node> >
639  findNodesThatProcessedObject(HOM_DopObject &dop_object) = 0;
640 
641  virtual HOM_BinaryString _parmClipData(double start,
642  double end,
643  bool binary = true,
644  bool use_blosc_compression = true,
645  double sample_rate = 0,
646  bool scoped_only = false) = 0;
647 
648  SWIGOUT(%kwargs _setParmClipData;)
649  virtual void _setParmClipData(HOM_BinaryString data,
650  bool binary = true,
651  bool blosc_compressed = true,
652  double sample_rate = 0,
653  double start = HOM_MIN_NEGATIVE_DOUBLE) = 0;
654 
655  virtual void _saveParmClip(std::string file_name,
656  double start,
657  double end,
658  double sample_rate = 0,
659  bool scoped_only = false) = 0;
660 
661  SWIGOUT(%kwargs _loadParmClip;)
662  virtual void _loadParmClip(std::string file_name,
663  double sample_rate = 0,
664  double start = HOM_MIN_NEGATIVE_DOUBLE) = 0;
665 
666  virtual int __creationTime() = 0;
667  virtual int __modificationTime() = 0;
668 
669 #ifdef SWIG
670 %extend
671 {
672  // evalParm() and evalParmTuple() need to be special methods because
673  // their return types can vary.
674  InterpreterObject evalParm(const char *parm_path)
675  {
676  HOM_Parm *parm = self->parm(parm_path);
677 
678  if (!parm)
679  throw HOM_OperationFailed("Invalid parm name");
680 
681  InterpreterObject result = HOMevalParm(*parm);
682  delete parm;
683  return result;
684  }
685 
686  InterpreterObject evalParmTuple(const char *parm_path)
687  {
688  HOM_ParmTuple *parm_tuple = self->parmTuple(parm_path);
689 
690  if (!parm_tuple)
691  throw HOM_OperationFailed("Invalid parm tuple name");
692 
693  InterpreterObject result = HOMevalParmTuple(*parm_tuple);
694  delete parm_tuple;
695  return result;
696  }
697 
698  void addEventCallback(
699  const std::vector<HOM_EnumValue *> &event_types,
700  InterpreterObject callback)
701  { self->addOpaqueEventCallback(event_types, callback); }
702 
703  void addParmCallback(
704  InterpreterObject callback,
705  const std::vector<std::string> &names)
706  { self->addOpaqueParmCallback(callback,names); }
707 
708  void removeEventCallback(
709  const std::vector<HOM_EnumValue *> &event_types,
710  InterpreterObject callback)
711  { self->removeOpaqueEventCallback(event_types, callback); }
712 
713 
714  std::vector<std::pair<std::vector<HOM_EnumValue *>, InterpreterObject> >
715  eventCallbacks()
716  {
717  std::vector<std::pair<std::vector<HOM_EnumValue *>, void *> >
718  opaque_callbacks(self->opaqueEventCallbacks());
719 
720  std::vector<std::pair<std::vector<HOM_EnumValue *>, InterpreterObject> >
721  callbacks;
722  for (int i=0; i< opaque_callbacks.size(); ++i)
723  callbacks.push_back(std::make_pair(
724  opaque_callbacks[i].first,
725  (InterpreterObject)opaque_callbacks[i].second));
726  return callbacks;
727  }
728 }
729 #endif
730 };
731 
732 #endif
type
Definition: core.h:977
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1222
void saveCodeToFile(const char *file_name, bool skip_header=false, const char *context_name=NULL)
Definition: HOM_Node.h:529
GT_API const UT_StringHolder time
GLuint start
Definition: glcorearb.h:474
HOM_Node()
Definition: HOM_Node.h:46
OIIO_API bool rename(string_view from, string_view to, std::string &err)
const GLuint GLenum const void * binary
Definition: glcorearb.h:1923
GLenum GLenum GLenum input
Definition: glew.h:14162
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
int isTimeDependent() const
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:353
GLuint const GLchar * name
Definition: glcorearb.h:785
void saveToCompiledVexFile(const char *file_name, const char *context_name=NULL)
Definition: HOM_Node.h:538
HOM_Node(const HOM_Node &node)
Definition: HOM_Node.h:49
GLuint64EXT * result
Definition: glew.h:14311
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
bool any(const vbool4 &v)
Definition: simd.h:3446
#define HOM_API
Definition: HOM_API.h:13
GLuint GLuint end
Definition: glcorearb.h:474
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1221
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:570
#define HOM_MIN_NEGATIVE_DOUBLE
Definition: HOM_Defines.h:46
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1296
virtual HOM_HDAModule * hm()
Definition: HOM_Node.h:281
GLuint const GLuint * names
Definition: glew.h:2695
~HOM_Node() override
Definition: HOM_Node.h:52
GT_API const UT_StringHolder version
OIIO_API void debug(string_view str)
GLubyte * pattern
Definition: glew.h:5741
GLboolean * data
Definition: glcorearb.h:130
GLsizei const GLfloat * value
Definition: glcorearb.h:823
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:556