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