HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OBJ_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  * NAME: OBJ library (C++)
7  *
8  * COMMENTS: This defines a base object, here, children will inherit
9  * my attributes...
10  *
11  * My input (there's only one ever) is my "parent" in the
12  * object hierarchy, thus, I can have as many children as
13  * I want, but only one parent.
14  *
15  */
16 
17 #ifndef __OBJ_Node_h__
18 #define __OBJ_Node_h__
19 
20 #include "OBJ_API.h"
21 #include "OBJ_Error.h"
22 #include "OBJ_NodeFlags.h"
23 #include "OBJ_XformCache.h"
24 
25 #include <DEP/DEP_TimedMicroNode.h>
26 #include <GEO/GEO_PackedTypes.h>
27 #include <GU/GU_DetailHandle.h>
28 #include <OP/OP_DataMicroNode.h>
29 #include <OP/OP_Network.h>
30 #include <OP/OP_Node.h>
32 #include <OP/OP_Version.h>
34 #include <UT/UT_Map.h>
35 #include <UT/UT_Matrix4.h>
36 #include <UT/UT_Playback.h>
37 #include <UT/UT_SmallArray.h>
38 #include <UT/UT_ValArray.h>
39 
40 #include <stddef.h>
41 
42 class CMD_Manager;
43 class GU_Detail;
44 class OBJ_Ambient;
46 class OBJ_Blend;
47 class OBJ_Bone;
48 class OBJ_Camera;
49 class OBJ_DopNet;
50 class OBJ_Fetch;
51 class OBJ_Fog;
52 class OBJ_Geometry;
53 class OBJ_Handle;
54 class OBJ_Light;
55 class OBJ_Null;
56 class OBJ_NodeParentTransform;
57 class OBJ_Rivet;
58 class OBJ_StereoCamera;
59 class OBJ_Sticky;
60 class OBJ_SubNet;
61 class OBJ_UndoPreTransform;
62 class OP_Options;
64 class PI_PropertyMap;
65 class SHOP_ReData;
66 class SOP_Node;
67 class UT_IStream;
68 class UT_Options;
69 class UT_String;
70 class UT_StringRef;
71 
72 
74 {
75  OBJ_WORLD = 0x00001, // unused
76  OBJ_GEOMETRY = 0x00002, // has geometry and should render
77  OBJ_CAMERA = 0x00004, // has viewing parameters
78  OBJ_LIGHT = 0x00008, // has light specific parameters
79  OBJ_RENDERER = 0x00010, // obsolete
80  OBJ_FOG = 0x00020, // atmosphere
81  OBJ_BONE = 0x00040, // bone parameters
82  OBJ_HANDLE = 0x00080, // geometry handle
83  OBJ_BLEND = 0x00100, // blend object
84  OBJ_FORCE = 0x00200, // object describing a force
85  OBJ_CAMSWITCH= 0x00400, // switch between multiple cameras
86  OBJ_SOUND = 0x00800, // sound object
87  OBJ_MICROPHONE = 0x01000, // microphone object
88  OBJ_SUBNET = 0x02000, // subnet object
89  OBJ_FETCH = 0x04000, // fetch object
90  OBJ_NULL = 0x08000, // null object
91  OBJ_STICKY = 0x10000, // sticky object
92  OBJ_DOPNET = 0x20000, // DOP network object
93  OBJ_RIVET = 0x40000, // rivet object
94  OBJ_MUSCLE = 0x80000,
95 
96  // the above are the basic types used in the bitfield defining
97  // an objects characteristics. Below are some common combinations.
98  OBJ_STD_LIGHT = OBJ_CAMERA|OBJ_LIGHT, // ambient doesn't have CAMERA
113 };
114 
116 {
121 };
122 
124 {
126  OBJ_SHADER_MATERIAL, // Assign shader to material
127  OBJ_SHADER_SPARE, // Parameter on object
128  OBJ_SHADER_PROPERTY, // Parameter on property SHOP
129 };
130 
132 {
135 };
136 
138 {
139  T,
140  R,
141  S,
142  P,
143  All
144 };
145 
146 #define OBJ_MATERIAL_SPARE_TAG "material_spare"
147 
149 {
150  // Transform
164 
175 
176  // Render
179 
180  // Misc
186 
187 
188  I_N_BASE_INDICES // should always be last in the list
189 };
190 
192  OBJ_VAR_IPT, // Instance point
194 };
195 
196 // We must maintain this order! If you change/add to OBJ_KeepPosType, then
197 // you must also fix it in OBJ_Command.C
199 {
203 
204  OBJ_KEEPPOS_NUM_FLAGS // should always be last in the list
205 };
206 
207 typedef enum {
212 
213 
214 #define OBJ_SELECTABLE_FLAG 'S'
215 
216 #define FLOAT_OBJ_PARM(name, idx, vi, t) \
217  return evalFloat(name, &getIndirect()[idx], vi, t);
218 #define FLOAT_OBJ_PARMS(name, idx, v, t) \
219  evalFloats(name, &getIndirect()[idx], v, t);
220 #define INT_OBJ_PARM(name, idx, vi, t) \
221  return evalInt(name, &getIndirect()[idx], vi, t);
222 #define STR_OBJ_PARM(name, idx, vi, t) \
223  evalString(str, name, &getIndirect()[idx], vi, t);
224 
225 #define SET_FLOAT(name, parm_index, vector_index, t, val, add_key) \
226  setChRefFloat(name, getIndirect()[parm_index], vector_index, t, val, add_key);
227 #define SET_INT(name, parm_index, vector_index, t, val) \
228  setChRefInt(name,getIndirect()[parm_index], vector_index, t, val);
229 #define SET_STRING(val, meaning, parm_index, vector_index, t) \
230  setChRefString(val, meaning, name, getIndirect()[parm_index], vector_index, t);
231 
233 {
234 public:
235  const char *getChildType() const override;
236  const char *getOpType() const override;
237 
238  OP_OpTypeId getChildTypeID() const override;
239  OP_OpTypeId getOpTypeID() const override;
240  static const char *theChildTableName;
241 
242  // We must never use the result of this method to do a c-style cast.
243  // If you need to cast, then use the casting methods provided.
244  virtual OBJ_OBJECT_TYPE getObjectType() const = 0;
245 
247  int var_id,
248  int thread) override;
249 
251  int index,
252  int thread) override
253  {
255  val, index, thread);
256  }
257 
258  // Global list of all known obsolete lists...
259  static PRM_Template *getObsolete();
260  static PRM_Template *mergeObsoleteLists(PRM_Template *t1,
261  PRM_Template *t2);
262  static CH_LocalVariable ourLocalVariables[];
263 
264  // This finds all the known types and resolves them. It doesn't mind
265  // if they don't exist.
267  PRM_ParmList *obsolete_parms) override;
268 
269  // Resolves a specific parm...
270  void applyBackwardsPathCompatibility(
271  PRM_ParmList *obsolete_parms,
272  const char *oldname,
273  const char *newname,
274  const char *root = "/obj/",
275  const char *tail = "");
276  void applyBackwardsNetNodeCompatibility(
277  PRM_ParmList *obsolete_parms,
278  const char *oldnetname,
279  const char *oldnodename,
280  const char *newname,
281  const char *rootname,
282  const char *property_parm=0);
283  // This is a SHOP specific style one. As SHOP_PATHs allowed any arbitrary
284  // path internally, merely requiring they are relative to /shop, we
285  // cannot just blindly prefix /shop/. Specifically, if the old path
286  // was /shop/bar, we don't want /shop//shop/bar.
287  void applyBackwardsShopCompatibility(
288  PRM_ParmList *obsolete_parms,
289  const char *oldname,
290  const char *newname);
291 
292  // These are convenience functions. Do NOT override in subclasses!
293  // Override the appropriate apply.*Transform() function instead!
294  // NOTE: there are exceptions to the comment above. Notably, the
295  // OBJ_Bone class has no notion of scaling along one axis only.
296  // It also treats rotations specially, and therefore it overrides
297  // the parameter transformation methods below.
298 
299  /// Get the transform built from the trs parms of this object
300  /// @param context The cook context, which contains the time.
301  /// @param xform The output parameter, that contains the matrix described
302  /// by the transformation parameters (rotation, tranlation,
303  /// and scale).
304  virtual bool getParmTransform(OP_Context &context, UT_DMatrix4 &xform );
305  virtual bool getParmTransformRotates(OP_Context &context,
306  UT_DMatrix4 &xform );
307  virtual bool getParmTransformTranslates(OP_Context &context,
308  UT_DMatrix4 &xform );
309  virtual bool getParmTransformScales(OP_Context &context,
310  UT_DMatrix4 &xform );
311 
313  { return myUseFullTransformModel; }
314 
315  /// Is given name an extended parm that requires extra checking for
316  /// transform/limit properties.
317  static bool isExtTransformParm(const UT_StringRef &name);
318 
319  // Delete all channels on the transform parms.
320  void destroyTransformParmChannels();
321 
322  // set the trs parms of the object to match the given world
323  // transform. rigid parm transform omits scales. Returns
324  // false if fail_if_any_locked_parms is true and any of the
325  // parms are locked. Whether or not we change locked
326  // parms, when not automatically failing, is specified by
327  // skip_locked_parms.
328  bool setParmTransformFromWorld(
329  OP_Context &context, const UT_DMatrix4 &world_xform,
330  bool create_keys = false,
331  bool fail_if_any_locked_parms = false,
332  bool change_locked_parms = false);
333  void setRigidParmTransformFromWorld(
334  OP_Context &context, const UT_DMatrix4 &world_xform,
335  bool create_keys = false );
336  // set the trs parms of the object to match the given parm
337  // transform. rigid parm transform omits scales. Returns
338  // false if fail_if_any_locked_parms is true and any of the
339  // parms are locked. Whether or not we change locked
340  // parms, when not automatically failing, is specified by
341  // skip_locked_parms.
342  bool setParmTransform( OP_Context &context, const UT_DMatrix4 &xform,
343  bool create_keys = false,
344  bool fail_if_any_locked_parms = false,
345  bool change_locked_parms = false,
346  const UT_Vector3R *rotate_vals = NULL
347  );
348 
349  void setRigidParmTransform( OP_Context &context,
350  const UT_DMatrix4 &xform,
351  bool create_keys = false );
352 
353  /// Get the pivot transform built from the pivot parms of this object
354  /// @param context The cook context, which contains the time.
355  /// @param xform The output parameter, that contains the matrix described
356  /// by the pivot transformation parameters (rotation and
357  /// and translation).
358  bool getParmPivotTransform(OP_Context &context, UT_DMatrix4 &xform);
359 
360  /// Set the pivot transform parms from the rotates and translates in the
361  /// given xform matrix.
362  bool setParmPivotTransform(OP_Context &context, const UT_DMatrix4 &xform,
363  bool create_keys = false,
364  bool fail_if_any_locked_parms = false,
365  bool change_locked_parms = false,
366  const UT_Vector3R *rotate_vals = NULL);
367 
368  /// Obtains an accumulation of input independedn and pre-transform matrices.
369  /// This is equivalent to:
370  /// applyPreTransform(applyInputIndependent(identity))
371  /// Which is is the portion of the local transform that does not
372  /// depend on the parameters (transform or look-at). It is not widely used
373  /// and only relevant for the handles to orient themselves in parent space.
374  ///
375  /// @param context The cook context, which contains the time.
376  /// @param mat The output parameter that will contain the calculated
377  /// matrix.
378  /// @return 0 if mat is the identity, non-zero otherwise.
379  int getPreLocalTransform(OP_Context &context, UT_DMatrix4 &mat);
380 
381  /// Obtains the effective local transform which does not depend on input
382  /// nodes. This transform includes input independent matrix, pre-transform
383  /// matrix, parameter transform matrix, and the look-at matrix. This method
384  /// first cooks the object (if necessary) and then returns the member
385  /// variable myXform.
386  ///
387  /// @param context The cook context, which contains the time.
388  /// @param mat The output parameter that will contain the calculated
389  /// matrix.
390  bool getLocalTransform(OP_Context &context, UT_DMatrix4 &mat);
391 
392  /// Calculates the inverse of the getLocalToWorldTransform()
393  bool getInverseLocalToWorldTransform(
394  OP_Context &context, UT_DMatrix4 &mat);
395 
396  /// Returns the effective world transform of the parent.
397  /// The input depenent transform ensures that any externally dependent
398  /// transformation have been taken into account (eg, the length of the
399  /// parent bone for OBJ_Bone). This transform is the base to which all the
400  /// local transforms are applied (pre-transform, parameter, etc).
401  ///
402  /// In terms of methods this is calculated by
403  /// applyInputDependentTransform(
404  /// getParentObject()->getChildToWorldTransform())
405  /// If @c getParentObject() is @c NULL, then it simply returns @c
406  /// applyInputDependentTransform(identity_matrix).
407  ///
408  /// Use this function to convert
409  /// coordinates that have @b not been transformed by the follow path or
410  /// pre-transform. Typically, this function is only used internally for
411  /// manipulating the pre-transform. If the object is in a subnet,
412  /// then this will include the subnet's world transform.
413  ///
414  /// @param context The cook context, which contains the time.
415  /// @param mat The output parameter that will contain the calculated
416  /// matrix.
417  bool getParentToWorldTransform(OP_Context &context, UT_DMatrix4 &mat);
418 
419  /// Returns a transform matrix that is only missing the
420  /// local and look-at components.
421  /// In terms of methods this is calculated by
422  /// applyPreTransform( applyInputIndependentTransform(
423  /// getParentToWorldTransform()))
424  /// Use this function to convert co-ordinates from object space to world
425  /// space. Object space includes everything @b except the object's local
426  /// transform parameters. Typically, this function is used by handles to
427  /// place themselves relative to the origin of the object.
428  ///
429  /// @param context The cook context, which contains the time.
430  /// @param mat The output parameter that will contain the calculated
431  /// matrix.
432  bool getObjectToWorldTransform(OP_Context &context, UT_DMatrix4 &mat);
433 
434  /// Calculates the inverse of the getObjectToWorldTransform().
435  bool getInverseObjectToWorldTransform(
436  OP_Context &context, UT_DMatrix4 &mat);
437 
438  /// Returns the full world transform of the object including
439  /// all the component sub-matrices (parent and local).
440  /// This is equivalent to
441  /// getLocalTransform() * getParentToWorldTransform()
442  /// Use this function to convert co-ordinates from the local (geometry)
443  /// space to world space. It cooks the object first and returns the member
444  /// variable @c myWorldTransform. Typically, this function is used to place
445  /// child SOPs of the object in world space.
446  ///
447  /// @param context The cook context, which contains the time.
448  /// @param mat The output parameter that will contain the calculated
449  /// matrix.
450  bool getLocalToWorldTransform(OP_Context &context, UT_DMatrix4 &mat);
451 
452  /// Returns the transforms provided by the object's parent.
453  /// This is equivalent to applyOutputTransform( getLocalToWorldTransform())
454  /// Typically, this function is only used internally for the implementation
455  /// of @c getParentToWorldTransform().
456  ///
457  /// Note that in general, the following inequality holds, unless @c
458  /// applyInputDependentTransform() has no effect:
459  /// @code
460  /// getParentToWorldTransform() !=
461  /// getParentObject()->getChildToWorldTransform()
462  /// @endcode
463  bool getChildToWorldTransform(OP_Context &context, UT_DMatrix4 &mat);
464 
465 
466  /// Obtains the world space matrix before the constraints were applied.
467  ///
468  /// @param context The cook context, which contains the time.
469  /// @param mat The output parameter that will contain the calculated
470  /// matrix.
471  SYS_DEPRECATED(16.5) // No longer needed or functional.
472  bool getPreConstraintsTransform(OP_Context &context, UT_DMatrix4 &mat);
473 
474  // single precision versions of the above functions
475  // (slightly less efficient since it has to do it in double precision and
476  // then assign it to single precision)
477  bool getParmTransform(OP_Context &context, UT_Matrix4 &xform );
478  bool getParmPivotTransform(OP_Context &context, UT_Matrix4 &xform );
479  int getPreLocalTransform(OP_Context &context, UT_Matrix4 &mat);
480  bool getLocalTransform(OP_Context &context, UT_Matrix4 &mat);
481  bool getParentToWorldTransform(OP_Context &context, UT_Matrix4 &mat);
482  bool getObjectToWorldTransform(OP_Context &context, UT_Matrix4 &mat);
483  bool getInverseObjectToWorldTransform(
484  OP_Context &context, UT_Matrix4 &mat);
485  bool getLocalToWorldTransform(OP_Context &context, UT_Matrix4 &mat);
486  bool getInverseLocalToWorldTransform(
487  OP_Context &context, UT_Matrix4 &mat);
488  bool getChildToWorldTransform(OP_Context &context, UT_Matrix4 &mat);
489  SYS_DEPRECATED(16.5) // No longer needed or functional.
490  bool getPreConstraintsTransform(OP_Context &context, UT_Matrix4 &mat);
491 
492  // 2d methods.
493  bool getLocal2DToWorldTransform(OP_Context &context, UT_DMatrix4 &mat);
494  virtual bool get2DWorldTransform(UT_DMatrix4 &mat, OP_Context &context);
495 
496  // functions to override those in OP_Node.h
497  bool getWorldTransform(UT_Matrix4D &mat,
498  OP_Context &context) override;
499  bool getIWorldTransform(UT_Matrix4D &mat,
500  OP_Context &context) override;
501  bool getTransform(TransformMode mode, UT_Matrix4D &mat,
502  OP_Context &context) override;
503  int getRelativeTransform(OP_Node &to,
504  UT_Matrix4 &xform,
505  OP_Context &context) override;
506  int getRelativeTransform(OP_Node &to,
507  UT_DMatrix4 &xform,
508  OP_Context &context) override;
509 
510  // This is used by specialized channel functions like qlinear()
511  // to determine what the transform order should be:
512  void getXformOrder(UT_XformOrder &xord,
513  const CH_Channel *chp) const override;
514 
515  // the following two methods are to be used along with
516  // keepWorldTransformByOldInput()
517  int keepPosWhenParenting();
518  bool getPreTransformInput(OP_Context &context,
519  UT_DMatrix4 &mat);
520  int keepPosWhenMoving();
521 
522  /// This method considers the effect of the LOOKAT fields and produces
523  /// a matrix that should be premultiplied to the orienation to get the
524  /// lookat. It takes the local->world transform (myWorldXform) as this
525  /// is used to figure out where this is outside cookpaths.
526  /// If 'interest' is supplied, then interest will be onto this other node
527  /// instead.
528  /// NOTE: this function is virtual, because OBJ_Bone has a "capture"
529  /// mode in which the lookAt parameter (or input node's transform
530  /// for that matter) is ignored. Bones
531  /// override this method to provide the mode-dependent transorm.
532  /// @param context The cook context, which contains the time.
533  /// @param world The world matrix based on which the lookat matrix is
534  /// calculated.
535  /// @param lookat The output parameter that will contain a calucated
536  /// look-at matrix. That look-at matrix will be
537  /// pre-multiplied with the local and the world transforms
538  /// to calculate their final form.
539  /// @param interest Usually, this node will register an interest in the
540  /// look-at object, so it gets dirtied when the look-at
541  /// object moves. The interest parameter specifies a node
542  /// that should be dirtied instead of the object on which
543  /// buildLookAt() got invoked.
544  ///
545  /// @return This returns 0 if no lookat is needed, in which case the matrix
546  /// provided will not be altered!
547  virtual int buildLookAt(OP_Context &context,
548  const UT_DMatrix4 &world,
549  UT_DMatrix4 &lookat,
550  OP_Node *interest = 0);
551  /// A stand alone version of buildLookAt that is not connected to the ui
552  /// and always takes an upvector.
553  int buildLookAt(OP_Context &context,
554  const UT_DMatrix4 &worldxform,
555  const UT_String &lookat,
556  UT_DMatrix4 &lookatxform,
557  UT_Vector3R &up);
558  // Returns whether or not the lookat object is time dependent.
559  bool getLookatObjectIsTimeDependent(const UT_String &lookat,
560  fpreal t);
561  // Returns the local to world transform of the lookat object.
562  // Optionally adds an extra input. Returns true if a valid lookat
563  // object was found. Sets xform to identity if no lookat or an
564  // invalid lookat was found.
565  bool getLookatObjectTransform(const UT_String &lookat,
566  OP_Context &context,
567  OP_Node *addextrainputto,
568  UT_DMatrix4 &xform,
569  bool &timedep);
570  // getPreLookatTransform gives us the pretransform matrix for an object
571  // that can later be used to create a lookat matrix with buildinglookat.
572  // getPreLooaktTransform can calculate the whole prelook at matrix,
573  // which is the default setting or calculate the matrix without the
574  // rotates included.
575  int getPreLookatTransform(OP_Context &context,
576  UT_DMatrix4 &wolrdXform,
577  UT_DMatrix4 &xform,
578  bool norotates = false);
579  // maintain the original world position as if we were using the old
580  // parent world xform by modifying the pretransform
581  int keepWorldTransformByOldInput(OP_Context &context,
582  const UT_DMatrix4 &old_parent_world_xform);
583 
584  // maintain the last cooked world transform by modifying pretransform/parms
585  void keepLastWorldTransform(OP_Context &context);
586 
587  // Returns whether or not the lookat object is time dependent.
588  bool getPathObjectIsTimeDependent(const UT_String &path,
589  fpreal t);
590  // Returns the local to world transform of the lookat object.
591  // Optionally adds an extra input. Returns true if a valid lookat
592  // object was found. Sets xform to identity if no lookat or an
593  // invalid lookat was found.
594  bool getPathObjectDetailHandle(const UT_String &path,
595  OP_Context &context,
597  UT_DMatrix4 &xform);
598 
599  // Callback for building custom world transforms from objects.
600  // The callback is responsible for setting the given matrix by
601  // the parm transform of the object.
602  // An example of using this would simply do
603  // node->getParmTransform(context,mat)
604  // Return 0 to stop processing, 1 to continue.
605  typedef int (*ApplyParmTransformCallback)(
606  void *data, OBJ_Node *node,
607  OP_Context &context, UT_DMatrix4 &mat);
608 
609  // Use these functions to build your own custom world transforms instead
610  // of traversing the object hieararchy yourself! If you do it yourself,
611  // then you will probably not take into account the output and
612  // pre-transforms.
613  // DO NOT CALL THESE WITHIN AN OBJECT COOK PATH!!
614  void buildCustomChildToWorldTransform(
615  OP_Context &context, UT_DMatrix4 &mat,
616  ApplyParmTransformCallback callback, void *data);
617  void buildCustomObjectToWorldTransform(
618  OP_Context &context, UT_DMatrix4 &mat,
619  ApplyParmTransformCallback callback, void *data);
620 
621  /// Set the given world position by only modifying the pre-transform.
622  /// This is less efficient than keepWorldTransformByOldInput() but more
623  /// general. If your local t,r,s parms have not been modified, then use
624  /// keepWorldTransformByOldInput instead.
625  ///
626  /// @param context The cook context, which contains the time.
627  /// @param world_xform The world transform to set for this object.
628  /// @param allow_extract If true, extract to local xform where possible
629  virtual int keepWorldTransform(
630  OP_Context &context,
631  const UT_DMatrix4 &world_xform,
632  bool allow_extract = false );
633 
634  // this is overridden so that we can clear our own undo flags
635  void clearUndoFlags() override;
636 
637  /// Stores the current pre-transform for future undo.
638  void savePreTransformForUndo();
639 
640  /// This sets the pre-transform to the identity matrix. This will modify
641  /// the object's world transform unless the pre-transform was already the
642  /// identity.
643  void resetPreTransform();
644 
645  /// This transfers the object's transform parameters (@c L) to the
646  /// pre-transform. This does not modify the effective world transform.
647  virtual void transferLocalToPreTransform(fpreal gtime);
648 
649  /// This extracts the object's pre-transform into its transform parameters.
650  /// If the extraction involved shears, then only the non-sheared portion
651  /// is extracted. This does not modify the effective world transform.
652  virtual void transferPreToLocalTransform(
653  fpreal gtime, bool follow_chan_refs = false);
654 
655  /// Transfers only the rotate portion of the matrix to pre-transform.
656  virtual void transferLocalToPreTransformRotates(fpreal gtime);
657 
658  /// Transfers only the translates portion of the matrix to pre-transform.
659  virtual void transferLocalToPreTransformTranslates(fpreal gtime);
660 
661  /// Transfers only the scales portion of the matrix to pre-transform.
662  virtual void transferLocalToPreTransformScales(fpreal gtime);
663 
664  /// This sets the pretransform to the given matrix. This will modify the
665  /// object's effective world transform unless the given pre-transform is
666  /// identity.
667  void setPreTransform(const UT_DMatrix4 &xform);
668 
669  // get the rotation euler angles that include the pre-transform
670  void getAdjustedRotates(OP_Context &context, UT_Vector3R &r);
671 
672  // Takes the given rotation in degrees and adjusts it to include the
673  // pretransform
674  void adjustRotatesToIncludePreTransform(
675  OP_Context &context, UT_Vector3R &r);
676 
677  // adjust the given rotations (in degrees) suitable for stuffing into a
678  // rotation parm taking into account the pre-transform
679  void adjustRotatesForPreTransform(
680  OP_Context &context,
681  int return_as_radian, UT_Vector3R &rot);
682 
683  /// Returns current pretransform matrix.
684  const UT_DMatrix4 & getPreTransform() const
685  { return myPreTransform; }
687  { return myPreTransform; }
689  { return myPreTransformIsIdentity; }
691  { myPreTransformIsIdentity = yesno; }
692 
693  bool setPickable(bool onoff) override;
694  bool getPickable() override;
695  bool setCachable(bool onoff);
696  bool getCachable(int thread) const;
697  void setFlag(char flag, int8 val) override;
698 
699  bool getBoundingBox(UT_BoundingBox &box,
700  OP_Context &ctx) override;
701 
703  { return CAST_SOPNODE(getDisplayNodePtr()); }
705  { return CAST_SOPNODE(getRenderNodePtr()); }
707  { return CAST_DOPNODE(getDisplayNodePtr()); }
708 
709  // Return the SOP that the display geometry is taken from without actually
710  // cooking the SOP. Should be used instead of getDispalySopPtr(), as this
711  // takes instancing and Output SOPs into account.
712  SOP_Node *getDisplayOutputNode(OP_Context &context,
713  bool check_enable);
714 
715  GU_DetailHandle getDisplayGeometryHandle(OP_Context &context,
716  int check_enable=1,
717  OP_Node **source_node=0);
718  GU_DetailHandle getRenderGeometryHandle(OP_Context &context,
719  int check_enable=1);
720  const GU_Detail *getDisplayGeometry(OP_Context &context,
721  int check_enable=1,
722  OP_Node **source_node=0);
723  const GU_Detail *getRenderGeometry(OP_Context &context,
724  int check_enable=1);
725 
727  {
730  DEFORM
731  };
732  virtual obj_OnionSkin getOnionSkin() { return OFF; }
733  static void buildOperatorTable(OP_OperatorTable &table);
734  static void getManagementOperators(OP_OperatorList &op);
735  static void installCommands(CMD_Manager *cman);
736  static void initializeExpressions();
737  static void buildMaterialOptMenu(void *obj,
738  PRM_Name *names,
739  int size,
740  const PRM_SpareData *spare,
741  const PRM_Parm *parm);
742  static int handleMaterialOpt(void *obj,
743  int index,
744  fpreal now,
745  const PRM_Template *tplate);
746  bool processMaterialOpt(fpreal now, const char *operation,
747  int argc, const char *argv[],
748  UT_String &errors);
749 
750 
751  // These convience functions allow you to deal with COP2 paths
752  // and prepare them in a fashion the TIL resolver will liek.
753  int getFullCOP2Path(const char *relpath,
754  UT_String &fullpath, int &flagdependent);
755  void splitCOP2Path(const char *path,
756  UT_String &net, UT_String &nodepath);
757 
758 
759  // Menu callback functions available to general public
760 
761  static void buildObjectMenu(PRM_Name *, int max,
763  static void buildGeoObjMenu(
764  void *o, PRM_Name *, int,
765  const PRM_SpareData *, const PRM_Parm *);
766  static void buildPathObjMenu(
767  void *o, PRM_Name *, int,
768  const PRM_SpareData *, const PRM_Parm *);
769  static void buildKinChopMenu(
770  void *o, PRM_Name *, int,
771  const PRM_SpareData *, const PRM_Parm *);
772  static void buildPopGeoMenu(
773  void *o, PRM_Name *, int,
774  const PRM_SpareData *, const PRM_Parm *);
775  static void buildShadeObjMenu(
776  void *o, PRM_Name *, int,
777  const PRM_SpareData *, const PRM_Parm *);
778  static void buildColorPlaneMenu(
779  void *o, PRM_Name *, int,
780  const PRM_SpareData *, const PRM_Parm *);
781  static void buildAlphaPlaneMenu(
782  void *o, PRM_Name *, int,
783  const PRM_SpareData *, const PRM_Parm *);
784  static void buildGeoChopMenu(
785  void *o, PRM_Name *, int,
786  const PRM_SpareData *, const PRM_Parm *);
787  static void buildSoundChopMenu(
788  void *o, PRM_Name *, int,
789  const PRM_SpareData *, const PRM_Parm *);
790  static void buildMicChopMenu(
791  void *o, PRM_Name *, int,
792  const PRM_SpareData *, const PRM_Parm *);
793  static void buildChopNetMenu(
794  void *o, PRM_Name *, int,
795  const PRM_SpareData *, const PRM_Parm *);
796  static void buildBoneCaptureMenu(
797  void *o, PRM_Name *, int,
798  const PRM_SpareData *, const PRM_Parm *);
799  static void buildBoneChildMenu(
800  void *o, PRM_Name *, int,
801  const PRM_SpareData *, const PRM_Parm *);
802  static void buildChildObjMenu(
803  void *o, PRM_Name *, int,
804  const PRM_SpareData *, const PRM_Parm *);
805  static void buildPointGroupMenu(
806  void *o, PRM_Name *, int,
807  const PRM_SpareData *, const PRM_Parm *);
808  static void buildPrimitiveGroupMenu(
809  void *o, PRM_Name *, int,
810  const PRM_SpareData *, const PRM_Parm *);
811 
812  static int handlePreTransformMenu(void *o, int index, fpreal t,
813  const PRM_Template *);
814 
815  bool getDisplayOrigin() const override;
816  bool setDisplayOrigin(bool on_off_unchanged) override;
817 
819  { return myObjFlags.getParentingErrorFlag(); }
821  { myObjFlags.setParentingErrorFlag(o); }
822 
823  int isCookingRender() const override
824  { return myCookingRender ? 1:0; }
825 
826  void setCookingRender(int val) override
827  { myCookingRender = (val!=0); }
828 
829  OBJ_NodeFlags &objflags() { return myObjFlags; }
830 
832  unsigned idx, OP_Node *op,
833  unsigned outputIdx = 0) override;
834 
836  unsigned idx, const char *label,
837  int keeppos,
838  unsigned outputIdx = 0) override;
839 
841  unsigned idx,
842  OP_IndirectInput *in) override;
843 
844  OP_ERROR setNamedInput(const OP_ConnectorId& input_name,
845  OP_Node *op,
846  const OP_ConnectorId* output_name = NULL
847  ) override;
848 
850  const OP_ConnectorId& input_name,
851  const char *label,
852  int,
853  const OP_ConnectorId* output_name = NULL) override;
854 
856  const OP_ConnectorId& input_name,
857  OP_IndirectInput *input) override;
858 
859  /// Override this to specify the inputs which are needed for cooking this
860  /// node which can be executed in parallel.
861  void getParallelInputs(
862  OP_Context &context,
863  OP_NodeList &nodes) const override;
864 
866  { ourKeepPosWhenParenting = flag; }
868  { return ourKeepPosWhenParenting; }
869 
871  { ourKeepPosWhenMoving = flag; }
873  { return ourKeepPosWhenMoving; }
874 
875  static void disallowGlobalKeepPos();
876  static void allowGlobalKeepPos();
877 
878  static void disallowIgnorePretransform();
879  static void allowIgnorePretransform();
880 
881  static void setIgnorePretransformValue(bool flag)
882  { ourIgnorePretransformValue = flag; }
883  static bool getIgnorePretransform()
884  { return ourAllowIgnorePretransform
885  && ourIgnorePretransformValue; }
887  { return ourIgnorePretransformValue; }
888 
889  void opChanged(OP_EventType reason,
890  void *data=0) override;
891  void referencedParmChanged(int parm_index) override;
892 
893  // takes into account TRS order and pivot point
894  UT_Vector3R getLocalPivot(OP_Context &context);
895  UT_Vector3R getWorldPivot(OP_Context &context);
896 
897  void setParmFromHandle(
898  OP_Context &context,
899  PRM_Parm &parm,
900  int vec_idx,
901  fpreal val,
902  bool create_keys,
903  bool check_modified);
904  void setParmFromHandle(
905  OP_Context &context,
906  PRM_Parm &parm,
907  const UT_Vector3R &val,
908  bool create_keys = false,
909  int key_idx = -1,
910  bool check_modified = true);
911 
912  virtual void setScaleFromHandle(fpreal t, const UT_Vector3R &s,
913  bool create_keys = false,
914  int key_idx = -1,
915  bool check_modified = true);
916  virtual void setUniformScaleFromHandle(
917  fpreal t, fpreal uniform_scale,
918  bool create_keys = false,
919  bool check_modified = true);
920  virtual void setRotateFromHandle(fpreal t, const UT_Vector3R &r,
921  bool create_keys = false,
922  int key_idx = -1,
923  bool check_modified = true);
924  virtual void setTranslateFromHandle(fpreal t,
925  const UT_Vector3R &trans,
926  bool create_keys = false,
927  int key_idx = -1,
928  bool check_modified = true);
929  virtual void setPivotFromHandle(fpreal t,
930  const UT_Vector3R &pivot,
931  bool create_keys = false,
932  int key_idx = -1,
933  bool check_modified = true);
934  virtual void setPivotRotateFromHandle(fpreal t,
935  const UT_Vector3R &pivot_rotate,
936  bool create_keys = false,
937  int key_idx = -1,
938  bool check_modified = true);
939  void setXformOrderFromHandle(fpreal t, int value,
940  bool create_keys = false,
941  bool check_modified = true);
942 
943  virtual const char * getSetScaleParmName() const { return "s"; }
944  virtual const char * getSetRotateParmName() const { return "r"; }
945  virtual const char * getSetTranslateParmName() const { return "t"; }
946 
947  // Determines whether an object should be sent to renderers or not.
948  virtual int isObjectRenderable(fpreal t) const;
949 
950  // Function returns whether the object is lit by a particular light
951  virtual int isObjectLitBy(OBJ_Node *, fpreal) { return 0; }
952  /// Function to resolve lighting based on light masks
953  virtual bool isLightInLightMask(const OBJ_Node *light, fpreal now)
954  { return false; }
955 
956  // Function returns whether the object is lit by a particular subnet
957  virtual int isObjectLitBySubnet(OBJ_Node *, fpreal) { return 0; }
958 
959  // Function to return the subset of the specified lights which actually
960  // light this object. The default implementation uses the virtual
961  // isObjectLitBy method to determine this subset.
962  virtual void getActingLightSubset(
963  const UT_ValArray<OBJ_Ambient *> &lights,
965 
966  /// Return an interface to apply appearance operations. The default
967  /// behaviour is to return a NULL pointer.
968  virtual SOP_ObjectAppearancePtr getObjectAppearance();
969 
970  // Let each object type decide whether or not it should be drawn lit
971  virtual int doDrawLit() const { return 0; }
972 
973  static const char * displaySopToken;
974  static const char * renderSopToken;
975  static const char * boundingBoxToken;
976  static const char * boundingSphereToken;
977  static const char * input1ObjectToken;
978  static const char * input2ObjectToken;
979  static const char * input3ObjectToken;
980  static const char * input4ObjectToken;
981 
983  OP_Context &context,
984  OP_NodeInfoParms &iparms) override;
986  UT_InfoTree &tree,
987  const OP_NodeInfoTreeParms &parms) override;
988 
989  void propagateEndBlockModify() override;
990 
991  //Absolute Width
992  fpreal getW() const override;
993  //Absolute Height
994  fpreal getH() const override;
995 
996 
997  virtual OBJ_Ambient *castToOBJAmbient() { return NULL; }
998  virtual OBJ_Blend *castToOBJBlend() { return NULL; }
999  virtual OBJ_Bone *castToOBJBone() { return NULL; }
1000  virtual OBJ_Camera *castToOBJCamera() { return NULL; }
1001  virtual OBJ_DopNet *castToOBJDopNet() { return NULL; }
1002  virtual OBJ_Fetch *castToOBJFetch() { return NULL; }
1003  virtual OBJ_Fog *castToOBJFog() { return NULL; }
1004  virtual OBJ_Geometry*castToOBJGeometry() { return NULL; }
1005  virtual OBJ_Handle *castToOBJHandle() { return NULL; }
1006  virtual OBJ_Light *castToOBJLight() { return NULL; }
1007  virtual OBJ_Null *castToOBJNull() { return NULL; }
1008  virtual OBJ_Rivet *castToOBJRivet() { return NULL; }
1009  virtual OBJ_Sticky *castToOBJSticky() { return NULL; }
1010  virtual OBJ_SubNet *castToOBJSubNet() { return NULL; }
1011  virtual OBJ_StereoCamera* castToOBJStereoCamera() { return NULL; }
1012 
1013  // Build a shader string for the object. If the shader string is built
1014  // successfully, the SHOP which generated the string will be returned.
1015  bool assignShader(int shop_type, const char *path,
1016  OBJ_SHADER_LOCATION where);
1017  OP_Node *evalShaderString(UT_String &shader, int shop_type, fpreal now,
1018  const UT_Options *options, OP_Node *shader_node = 0);
1019  bool evalShaderHandle(UT_String &handle, int shop_type, fpreal now,
1020  const UT_Options *options, OP_Node *shader_node = 0);
1021  bool evalShaderLanguage(UT_String &lang, int shop_type, fpreal now,
1022  const UT_Options *options, OP_Node *shader_node = 0);
1023  OP_Node *evalShaderData(SHOP_ReData &data, int shop_type, fpreal now,
1024  const UT_Options *options, OP_Node *shader_node = 0);
1025  OP_Node *evalShaderBounds(UT_BoundingBox &box, int shop_type,fpreal now,
1026  const UT_Options *options, OP_Node *shader_node = 0);
1027  bool evalCoShaderStrings(UT_StringArray &strings,
1028  OP_NodeList &shops, int shop_type, fpreal now,
1029  const UT_Options *options, OP_Node *shader_node = 0);
1030  bool evalCoShaderHandles(UT_StringArray &handles,
1031  int shop_type, fpreal now,
1032  const UT_Options *options, OP_Node *shader_node = 0);
1033  bool evalCoShaderLanguages(UT_StringArray &languages,
1034  int shop_type, fpreal now,
1035  const UT_Options *options, OP_Node *shader_node = 0);
1036  void getShopTransform(UT_DMatrix4 &xform, int shop_type,
1037  fpreal now, const UT_Options *options);
1038 
1039  // Returns the token (name) of the material parameter.
1040  static const char *getMaterialParmToken();
1041 
1042  // Get a node specified as a material
1043  OP_Node *getMaterialNode( fpreal now );
1044 
1045  // Get a particular SHOP.
1046  OP_Node *getShaderNode(OP_Node *candidate, int shader_type,
1047  fpreal now, const UT_Options *options);
1048  OP_Node *getShaderNode(int shader_type, fpreal now,
1049  const UT_Options *options,
1050  DEP_MicroNode *dep = NULL);
1051 
1052  DEP_MicroNode *getMaterialParmMicroNode();
1053 
1054  // Load up the options with the local parameter defintions
1055  virtual const UT_Options *createShaderParms(OP_Options &options,
1056  fpreal now,
1057  const UT_Options *src);
1058 
1059  // Combine the SOPs of other objects into this one. On success, returns
1060  // the display_merge SOP pointer, else NULL.
1061  //
1062  // objs List of objects to combine. These will be deleted on
1063  // return.
1064  // full_combine If true, it performs a combine with the existing SOPs
1065  // inside this object.
1066  // moved_map Optional. On return, this filled with a map of the
1067  // child node pointers from source node pointer to
1068  // destination node pointer.
1069  OP_Node *combine(OP_Context &context,
1070  const UT_ValArray<OBJ_Node *> &objs,
1071  bool full_combine = true,
1072  UT_Map<OP_Node *, OP_Node *> *moved_map = NULL);
1073 
1074  virtual bool getHideDefaultParms() const
1075  { return false; }
1076 
1077  bool canCreateNewOpType() const override;
1078 
1079  const OP_DataMicroNode &
1080  parmListMicroNodeConst() const override
1081  { return myXformMicroNode; }
1083  { return parmListMicroNodeConst().modVersion(); }
1084 
1085  // myXformCookLevel is positive during the cook of myXform
1086  const OP_DataMicroNode &
1087  dataMicroNodeConst() const override
1088  {
1089  return (myXformCookLevel > 0)
1090  ? myXformMicroNode
1092  }
1093 
1094  // Set Parm Transform that can trigger notifications
1095  bool setParmTransform( OP_Context &context, const UT_DMatrix4 &xform,
1096  bool create_keys,
1097  bool fail_if_any_locked_parms,
1098  bool change_locked_parms,
1099  const UT_Vector3R *rotate_vals,
1100  bool check_modified
1101  );
1102  // Set Parm Pivot Transform that can trigger notifications
1103  bool setParmPivotTransform( OP_Context &context,
1104  const UT_DMatrix4 &xform,
1105  bool create_keys,
1106  bool fail_if_any_locked_parms,
1107  bool change_locked_parms,
1108  const UT_Vector3R *rotate_vals,
1109  bool check_modified
1110  );
1111 
1112  bool hasConstraints() const { return myHasConstraints; }
1113 
1114  bool getRawParmTransform(OP_Context &context, UT_DMatrix4 &xform );
1115  bool getRawParmTransform(OP_Context &context, UT_Matrix4 &xform );
1116 protected:
1117 
1118  OBJ_Node(OP_Network *parent, const char *name, OP_Operator *op);
1119  ~OBJ_Node() override;
1120 
1121  bool supportsDropShopType(int shop_type);
1123  const char *label) override;
1124 
1125  int testDragDrop(DD_Source &src) override;
1127  DD_ChoiceList &c) override;
1128 
1129 
1130  // This method should add any extra interests that an object might
1131  // have. By default, geo instance, particle instance, shader spaces
1132  // etc. are added. This is called when objects cook.
1133  virtual void addExtraDependencies(OP_Context &context);
1134  virtual int getOpShadingInfo(UT_String &str, fpreal t);
1135  virtual int getOpConstraintsInfo(UT_String &str, fpreal t);
1138  const CH_ChannelList &channels) override;
1140  PRM_ParmNameMap &nmap,
1141  UT_String &errors) override;
1143  const UT_StringRef &name, fpreal now,
1144  OP_Node *&op, PRM_Parm *&parm,
1145  bool create_missing_multiparms,
1146  PRM_ParmList *obsolete = 0) override;
1148  const UT_StringRef &name,
1149  fpreal now,
1150  OP_Node *&op, PRM_Parm *&parm, int &vectoridx,
1151  PRM_ParmList *obsolete = 0) override;
1153  OP_PropertyLookupList &list) override;
1154 
1155  /// Computes and pre-multiplies an input dependent matrix to the given
1156  /// current matrix. This transform is
1157  /// defined as semantically dependent on the object's inputs. The OBJ_Blend
1158  /// object overrides this to do special processing. Also, the OBJ_Bone
1159  /// object overrides this to move its origin to the tip of the parent bone.
1160  /// By default, this method does not modify the given matrix, which is
1161  /// equivalent to identity matrix.
1162  /// @param context The cook context, which contains the time.
1163  /// @param mat Input and output parameter, that gets premuliplied by
1164  // the computed input dependent transform matrix, if any.
1165  ///
1166  /// @return Returns 1 if the matrix was modified, 0 otherwise
1167  virtual int applyInputDependentTransform(
1168  OP_Context &context, UT_DMatrix4 &mat);
1169 
1170  /// Computes and pre-multiplies an input independent transform to
1171  /// the given matrix.
1172  /// This transform is defined as semantically independent of the
1173  /// object's inputs. The default implementation applies a follow path
1174  /// object transform, if available.
1175  ///
1176  /// @param context The cook context, which contains the time.
1177  /// @param mat Input and output parameter, that gets premuliplied by
1178  /// the computed input independent transform matrix, if any.
1179  ///
1180  /// @return Returns 1 if the matrix was modified, 0 otherwise
1181  virtual int applyInputIndependentTransform(
1182  OP_Context &context, UT_DMatrix4 &mat);
1183 
1184  /// Computes and pre-multiplies an output transform to the given matrix.
1185  /// The output transform is a transform that a parent specifies for its
1186  /// children. This concept exists for completeness (since there is an input
1187  /// transform), but is not widely used.
1188  /// The default implementation does not apply any transform.
1189  ///
1190  /// @param context The cook context, which contains the time.
1191  /// @param mat Input and output parameters, that gets premultipled
1192  /// by an appropriate output transform, if any.
1193  ///
1194  /// @return Returns 1 if the matrix was modified, 0 otherwise
1195  virtual int applyOutputTransform(OP_Context &context, UT_DMatrix4 &mat);
1196 
1197  /// Premuliplies the pre-transform matrix, myPreTransform, to the given
1198  /// matrix. Pre-matrix is a transformation layer between the input and the
1199  /// parameter transforms, and is used to define the origin point (and
1200  /// orientation) at which zero translation and zero rotation would place the
1201  /// object. This allows to have more meaningull parameter values during
1202  /// animation, where rotation of 0 degrees may need to correspond to a
1203  /// slightly bent limb (ie, rotated joint).
1204  ///
1205  /// @param context The cook context, which contains the time.
1206  /// @param mat The input and output parameter, that gets premultipled
1207  /// by a pre-transform matrix.
1208  ///
1209  /// @return Returns 1 if the matrix was modified, 0 otherwise
1210  virtual int applyPreTransform(OP_Context &context, UT_DMatrix4 &mat);
1211 
1212  bool getParentToWorldTransformForInputNoLock(
1213  OBJ_Node *input, OP_Context &context, UT_DMatrix4 &mat, bool applyInputDependentTransform=true);
1214 
1215  // Methods to obtatin and store transformations in a cache. Also
1216  // check if this object is or should be caching xform
1217  const UT_DMatrix4 & getCachedTransform( OP_Context &context,
1219  OBJ_XformCache::OBJ_LookupStatus &status ) const;
1220  void setCachedTransform( OP_Context &context,
1222  const UT_DMatrix4 &xform ) const;
1223  bool isCachingTransforms(int thread) const;
1224 
1225  bool updateParmsFlags() override;
1226 
1227  /// Used to perform proper dependency tracking when cooking the local
1228  /// transform (myXform) from cookMyObj().
1230  {
1231  public:
1232  LocalCookScope(OP_Context &context, OBJ_Node& obj, bool constraint=false);
1233  ~LocalCookScope();
1234  private:
1235  OP_Context& myContext;
1236  OBJ_Node& myObj;
1237  const bool myWasTimeDep;
1238  const bool myWasCooking;
1239  const bool myConstraint;
1240  };
1241  friend class LocalCookScope;
1242  friend class OBJ_NodeParentTransform;
1243 
1244  //
1245  // The cookMe "caches" information - i.e. the world and local xform matrix
1246  OP_ERROR cookMe(OP_Context &context) override;
1247  OP_ERROR bypassMe(OP_Context &context,
1248  int &copied_input) override;
1249  virtual OP_ERROR cookMyObj(OP_Context &context);
1250 
1251  OP_DataType getCookedDataType() const override;
1252  void deleteCookedData() override;
1253  int saveCookedData(const char *, OP_Context &) override;
1254  int saveCookedData(std::ostream &os,
1255  OP_Context &,
1256  int binary = 0) override;
1257 
1258  const char *getFileExtension(int binary) const override;
1259  OP_ERROR saveIntrinsic(std::ostream &os,
1260  const OP_SaveFlags &flags) override;
1261  void saveIntrinsicCommand(std::ostream &os,
1262  const char *name) override;
1263 
1264  bool loadPacket(UT_IStream &is, short class_id, short sig,
1265  const char *path=0) override;
1266  bool loadPacket(UT_IStream &is, const char *token,
1267  const char *path=0) override;
1268 
1269  void saveFlagsForUndo() override;
1270  void getSaveFlagsString(
1271  UT_String &cmd,
1272  const char *flags,
1273  bool save_to_hip) const override;
1274  void getPreParmSaveFlagsString(
1275  UT_String &cmd) const override;
1276  void getPostParmSaveFlagsString(
1277  UT_String &cmd) const override;
1278 
1279  // appends the description of the xform to the text. If the xform is not
1280  // an identity the label is printed first and the rst values follow.
1281  // If the xform is identity the text_if_identity is appended instead
1282  // of the whole label and xform printout
1283  void getXformDescription(const UT_DMatrix4 &xform,
1284  const char* label_if_not_identity,
1285  const char* text_if_identity,
1286  const UT_Vector3R pivot,
1287  const UT_Vector3R pivot_rotate,
1288  const UT_XformOrder order,
1289  UT_WorkBuffer &text);
1290 
1291  // types of transormations that we can clean (i.e.,
1292  // transfer from local to pre-transform)
1294  {
1298  OBJ_TRANSFORM_SCALES
1299  };
1300 
1301 
1302  /// Calculates a matrix that needs to be premultiplied with pretransform
1303  /// to transfer the transformation of type 'type' to the pretransform matrix
1304  void getParmTransformTransferMatrix(
1305  OP_Context &context,
1306  OBJ_TransformComponent type,
1307  UT_DMatrix4 &xform );
1308 
1309  // method for propagating the change in capture transform by xform.
1310  // This method is
1311  // overloaded for OBJs that support capture parameters (e.g., OBJ_Bone)
1312  // in order to adjust their global capture position. This is handy
1313  // when editing the caputre pose and when we need to propagate
1314  // a transofrm (e.g., translation) to all the descendants.
1315  virtual void applyToCaptTransformAndDescendents(
1316  OP_Context &context,
1317  const UT_DMatrix4 &xform );
1318 
1319  // method for building a menu containg point groups
1320  virtual void buildPointGroupMenu(
1321  PRM_Name *menu, int size,
1322  const PRM_SpareData *spare, const PRM_Parm *parm);
1323 
1324  // method for building a menu containg primitive groups
1325  virtual void buildPrimitiveGroupMenu(
1326  PRM_Name *menu, int size,
1327  const PRM_SpareData *spare, const PRM_Parm *parm);
1328 
1329 
1330 //_________________________________________________________________________
1331 //
1332 // Convenience Error methods...
1333 //_________________________________________________________________________
1334 //
1335  void addError(int code, const char *msg = 0)
1336  { UTaddError("OBJ", code, msg);}
1337  void addMessage(OBJ_Error code, const char *msg = 0)
1338  { UTaddMessage("OBJ", code, msg);}
1339  void addWarning(OBJ_Error code, const char *msg = 0)
1340  { UTaddWarning("OBJ", code, msg);}
1341  void addFatal(OBJ_Error code, const char *msg = 0)
1342  { UTaddFatal("OBJ", code, msg);}
1343 
1344 public:
1345 
1346  static PRM_SpareData *getMatchSelectButton(int option, int autoscope);
1347 // TODO: We have to make sure that the parent is cooked here!
1348  virtual OBJ_Node *getParentObject();
1350  { return setInput(0, node); }
1351 
1352  OBJ_Node *getInstanceObject(fpreal now) const;
1353  OBJ_Node *getGeometryInstance(fpreal now) const;
1354  OBJ_Node *getParticleObject(fpreal now) const;
1355 
1356  void setLookAtObject(OBJ_Node *node);
1357  void setLookUpObject(OBJ_Node *node);
1358  void setPathObject(OBJ_Node *node);
1359 
1360 protected:
1362  virtual int collectPropertiesFromChannels(
1363  PI_EditScriptedParms &editparms,
1365  const CH_ChannelList &channels);
1366  virtual int collectPropertiesFromParms(
1367  PI_EditScriptedParms &editparms,
1368  UT_StringArray &names,
1369  PRM_ParmNameMap &nmap);
1370  int collectProperties(PI_EditScriptedParms &editparms,
1372  const CH_ChannelList &channels,
1373  PI_PropertyMap *pmap);
1374  int collectProperties(PI_EditScriptedParms &editparms,
1375  UT_StringArray &names,
1376  PRM_ParmNameMap &nmap,
1377  PI_PropertyMap *pmap);
1378  void createPropertiesShop();
1379 
1380  // Method to find a SHOP node of a specific type. If the type is
1381  // SHOP_INVALID, any SHOP will be returned. Otherwise, the SHOP at the
1382  // given path must be of the correct type. NULL will be returned if the
1383  // type doesn't match or the path isn't found.
1384 
1385  // Used to get pointer to indirection indices for each object type
1386  virtual int *getIndirect() const = 0;
1387 
1389  int name_idx) const
1390  {
1391  int &parm_idx = getIndirect()[name_idx];
1392  if (parm_idx < 0)
1393  parm_idx = getParmList()->getParmIndex(name);
1394  return parm_idx;
1395  }
1397  int name_idx) const
1398  {
1399  int &parm_idx = getIndirect()[name_idx];
1400  if (parm_idx < 0)
1401  parm_idx = getParmList()->getParmIndex(name);
1402  return parm_idx;
1403  }
1404  PRM_Parm *getCachedParm(const UT_StringRef &name, int name_idx)
1405  {
1406  return getParmList()->getParmPtr(
1407  getCachedParmIndex(name, name_idx));
1408  }
1410  const UT_StringRef &name, int name_idx) const
1411  {
1412  return getParmList()->getParmPtr(
1413  getCachedParmIndex(name, name_idx));
1414  }
1415 
1416  virtual bool getTimeOverride() { return false; }
1417 
1418  // inverseDirty is no more needed because setWorldXform does it automatically.
1419  SYS_DEPRECATED_HDK_REPLACE(16.0, "setWorldXform")
1420  void inverseDirty() { myInverseDirty = true; }
1421 
1423  {
1424  if (myInverseDirty)
1425  {
1426  myInverseDirty = false;
1427  myWorldXform.invert(myIWorldXform);
1428  }
1429  return myIWorldXform;
1430  }
1431 
1432  // Compute the object contraints given a local and a parent transform.
1433  // The contraint network is evaluated and given the parent and local_xforms.
1434  // This updates myXform and myWorldXform.
1435  bool computeConstraints(OP_Context &context);
1436 
1437  // Returns the currently cooked local matrix. Doesn't perform cooking.
1439  { return myXform; }
1440 
1441  // Sets the cooked local matrix during cooking.
1443  { myXform = m; }
1444 
1445  // Returns the currently cooked world matrix. Doesn't perform cooking.
1447  { return myWorldXform; }
1448 
1449  // Sets the cooked world matrix during cooking.
1450  // Also sets the myInverseDirty flag properly.
1452  { myWorldXform = m; myInverseDirty=true; }
1453 
1454 public:
1456  { SET_FLOAT("t", I_T, 0, t, v, add_key) }
1458  { SET_FLOAT("t", I_T, 1, t, v, add_key) }
1460  { SET_FLOAT("t", I_T, 2, t, v, add_key) }
1462  { SET_FLOAT("r", I_R, 0, t, v, add_key) }
1464  { SET_FLOAT("r", I_R, 1, t, v, add_key) }
1466  { SET_FLOAT("r", I_R, 2, t, v, add_key) }
1468  { SET_FLOAT("s", I_S, 0, t, v, add_key) }
1470  { SET_FLOAT("s", I_S, 1, t, v, add_key) }
1472  { SET_FLOAT("s", I_S, 2, t, v, add_key) }
1474  { SET_FLOAT("p", I_P, 0, t, v, add_key) }
1476  { SET_FLOAT("p", I_P, 1, t, v, add_key) }
1478  { SET_FLOAT("p", I_P, 2, t, v, add_key) }
1481  { SET_FLOAT("pr", I_PIVOTR, 0, t, v, add_key) }
1484  { SET_FLOAT("pr", I_PIVOTR, 1, t, v, add_key) }
1487  { SET_FLOAT("pr", I_PIVOTR, 2, t, v, add_key) }
1490  { SET_FLOAT("scale", I_SCALE, 0, t, v, add_key) }
1491 
1492  void setTRANSORDER(int v) { SET_INT("xOrd", I_XORDER, 0, 0, v) }
1493  void setROTORDER(int v) { SET_INT("rOrd", I_RORDER, 0, 0, v) }
1494  void setKEEPPOS(int v) { SET_INT("keeppos", I_KEEPPOS, 0, 0, v) }
1495  void setCHILDCOMP(int v) { SET_INT("childcomp", I_CHILDCOMP, 0, 0, v) }
1496 
1497  int KEEPPOS(fpreal t) const { INT_OBJ_PARM("keeppos", I_KEEPPOS, 0, t) }
1498  int TRS(fpreal t) const { INT_OBJ_PARM("xOrd", I_XORDER, 0, t); }
1499  int XYZ(fpreal t) const { INT_OBJ_PARM("rOrd", I_RORDER, 0, t); }
1500  int CHILDCOMP(fpreal t) const { INT_OBJ_PARM("childcomp", I_CHILDCOMP, 0, t) }
1501 
1502  void T(fpreal *v, fpreal t) { FLOAT_OBJ_PARMS("t", I_T, v, t) }
1503  void R(fpreal *v, fpreal t) { FLOAT_OBJ_PARMS("r", I_R, v, t) }
1504  void S(fpreal *v, fpreal t) { FLOAT_OBJ_PARMS("s", I_S, v, t) }
1505  void P(fpreal *v, fpreal t) { FLOAT_OBJ_PARMS("p", I_P, v, t) }
1507  { FLOAT_OBJ_PARMS("pr", I_PIVOTR, v, t) }
1508 
1510 
1511  void LOOKUP(UT_String &str, fpreal t)
1512  { STR_OBJ_PARM ("lookup", I_LOOKUP, 0, t) }
1513  // types of allowed path parameterization
1514  // NB: these correspond to the menu entries in thePathParmTypes[]
1516  {
1517  OBJ_PATHPARM_UNIFORM = 0,
1518  OBJ_PATHPARM_ARCLEN
1519  };
1520 
1522  int PATHPARMTYPE(fpreal t) { INT_OBJ_PARM("uparmtype", I_PATHUPARMTYPE,0,t) }
1523  int PATHORIENT(fpreal t) { INT_OBJ_PARM("pathorient", I_PATHORIENT, 0, t) }
1526  { FLOAT_OBJ_PARMS("up", I_PATHUP, v, t) }
1528 
1529  int PICKING() {INT_OBJ_PARM("picking", I_PICKING, 0, 0) }
1531  {STR_OBJ_PARM("pickscript", I_PICKSCRIPT, 0, t)}
1532  int CACHING() {INT_OBJ_PARM("caching", I_CACHING, 0, 0) }
1533 
1534  // This parameter is only important in specific classes, so is not
1535  // defined here at the base level.
1536  virtual int VPORT_SHADEOPEN() { return 0; }
1537  virtual int VPORT_DISPLAYASSUBDIV() { return 0; }
1538 
1539  fpreal SHADERATE(fpreal t, fpreal defval=1);
1540  int PHANTOM(fpreal t, int default_value);
1541  int MATTE(fpreal t, int default_value);
1542  int RAYBOUNCE(fpreal t, int default_value);
1543  int TRANSMITBOUNCE(fpreal t, int default_value);
1544  fpreal RAYCLIP(fpreal t, fpreal def=0.001);
1545  fpreal DISPBOUND(fpreal t, fpreal def=0);
1546  fpreal SHADOWRATE(fpreal t, fpreal def=1);
1547  fpreal REFLRATE(fpreal t, fpreal def=1);
1548  fpreal LOD(fpreal t, fpreal def=1);
1549  void PREINCLUDE(UT_String &str, fpreal t);
1550  void POSTINCLUDE(UT_String &str, fpreal t);
1553 
1554 
1556  { return evalInt("use_dcolor", &getIndirect()[I_USE_DCOLOR],
1557  0, 0); }
1561 
1563  {
1564  UT_Color col(UT_RGB);
1565  fpreal32 c[3];
1566  evalFloats("dcolor", &getIndirect()[I_DCOLOR], c, t);
1567  col.setRGB(c[0], c[1], c[2]);
1568  return col;
1569  }
1570 
1572  { SET_FLOAT("dcolor", I_DCOLOR, 0, t, r, PRM_AK_MARK_PENDING) }
1574  { SET_FLOAT("dcolor", I_DCOLOR, 1, t, g, PRM_AK_MARK_PENDING) }
1576  { SET_FLOAT("dcolor", I_DCOLOR, 2, t, b, PRM_AK_MARK_PENDING) }
1577 
1578  int DISPLAY(fpreal t) const;
1579 
1580  int parmIndexDISPLAY() const
1581  { return getCachedParmIndex("display", I_DISPLAY); }
1582 
1583  // Determine whether the geometry is really displayed. If the display
1584  // channel is turned off, then we use the display flag. Use this as opposed
1585  // to isDisplayDisabled() unless you do *not* want to check this object's
1586  // display flag. A network can be specified to ignore the display state
1587  // of any parents starting with that network.
1588  bool getObjectDisplay(fpreal t, const OP_Network *n=0) const
1589  {
1590  return getDisplay() && !isDisplayDisabled(t, n);
1591  }
1592  GEO_ViewportLOD getObjectDisplayStyle(fpreal t,
1593  const OP_Network *net = NULL,
1594  bool ignore_display=false) const;
1595  bool isDisplayTimeDependent() const;
1596 
1597  // Determine whether the geometry is disabled for display. If the display
1598  // channel is turned off, then we use the display flag. A network can be
1599  // specified to ignore the display state of any parents starting with that
1600  // network.
1601  int isDisplayDisabled(fpreal t,
1602  const OP_Network *net = 0) const;
1603 
1604  // setVisible() differs from setDisplay() in that it will try to set the
1605  // display flag on parent subnets and change visible object parameters as
1606  // necessary.
1607  bool setVisible(bool onoff) override;
1608  bool getVisible() const override;
1609 
1610  void evaluateBatchParms(PRM_BatchList &list,
1611  fpreal now) override;
1612 
1613  // These parameters are cached
1614 
1615  int TDISPLAY() const;
1616  int parmIndexTDISPLAY() const
1617  {
1618  return getCachedParmIndex("tdisplay", I_TDISPLAY);
1619  }
1620 
1622  {
1623  return getCachedParmIndex("constraints_on", I_CONSTRAINTS_ON);
1624  }
1625 
1627  {
1628  return getCachedParmIndex("constraints_path", I_CONSTRAINTS);
1629  }
1630 
1631  int INSTANCE(UT_String &str, fpreal now) const;
1632  int POINTINSTANCE(fpreal now) const;
1633  int PARTICLE(UT_String &s, fpreal t) const;
1634  bool PTMOTIONBLUR(UT_String &str, fpreal now) const;
1635 
1636  int LOOKAT(UT_String &str, fpreal t) const
1637  {
1638  STR_OBJ_PARM ("lookatpath", I_LOOKAT, 0, t)
1639  return str.isstring();
1640  }
1641 
1642  int LOOKUPOBJ(UT_String &str, fpreal t) const
1643  {
1644  STR_OBJ_PARM ("lookupobjpath", I_LOOKUPOBJ, 0, t)
1645  return str.isstring();
1646  }
1647 
1648  int PATHSOP(UT_String &str, fpreal t) const
1649  {
1650  STR_OBJ_PARM ("pathobjpath", I_PATHOBJ, 0, t)
1651  return str.isstring();
1652  }
1653 
1654  // This is used by the viewer to determine whether or not to cook (and show)
1655  // particle guide geometry at the object level.
1657  { return getDefaultedIProperty("vport_promote_popguides", t,1); }
1658 
1659  // This is used by DM_VPortAgent3D to determine what order to
1660  // draw objects in. It itself will set it depending on user defined
1661  // order, so it really is a temporary one-per-object flag.
1662  int getDisplayOrder() const
1663  {
1664  return myDisplayOrder;
1665  }
1667  {
1668  myDisplayOrder = order;
1669  }
1670 
1671  // This is used by OBJ_SubNet. This is called on all child objects
1672  // when the Visible Children parameter changes.
1674  { myDisplayDisabledBySubnetNeedsUpdate = 1; }
1675 
1676  void addTransformParmInterests( OP_Node *interested );
1677 
1678  int getDefaultedIProperty(const char *name, fpreal now, int def) const
1679  {
1680  int val;
1681  if (evalParameterOrProperty(name, 0, now, val))
1682  return val;
1683  return def;
1684  }
1685  fpreal getDefaultedFProperty(const char *name, fpreal now, fpreal def) const
1686  {
1687  fpreal val;
1688  if (evalParameterOrProperty(name, 0, now, val))
1689  return val;
1690  return def;
1691  }
1692  const char *getDefaultedSProperty(const char *name, fpreal now,
1693  UT_String &result, const char *def) const
1694  {
1695  if (!evalParameterOrProperty(name, 0, now, result))
1696  result = def;
1697  return result;
1698  }
1699  const char *getDefaultedRawSProperty(const char *name, fpreal now,
1700  UT_String &result, const char *def) const
1701  {
1702  if (!evalParameterOrPropertyRaw(name, 0, now, result))
1703  result = def;
1704  return result;
1705  }
1706 
1707  int64 getMemoryUsage(bool inclusive) const override;
1708 
1709  OP_Node *getEvaluatedConstraints();
1710 
1711  // Evaluate the constraint path parameter and strip the optional channel name.
1712  OP_Node *parseConstraintPath( UT_String &path, UT_String &channel, int add_dep );
1713  OP_Node *parseConstraintPath( UT_String &path, UT_String &channel, int add_dep, bool &got_by_flag );
1714 
1715  const UT_Color &DCOLORREF(fpreal t, int &use_color)
1716  {
1717  if(myWireColorMicroNode.requiresUpdate(t))
1718  {
1719  mySetWireColor = USE_DCOLOR();
1720  if( mySetWireColor )
1721  {
1722  myWireColor.setType(UT_RGB);
1723 
1724  char *p = (char*)(void*)&myWireColor;
1725  p += sizeof(UT_ColorType);
1726 
1727  fpreal32* c = (fpreal32*)p;
1728  evalFloats("dcolor", &getIndirect()[I_DCOLOR],c,t);
1729  }
1730  auto i_usedcolor = getIndirect()[I_USE_DCOLOR];
1731  auto i_dcolor = getIndirect()[I_DCOLOR];
1732  if(i_usedcolor >= 0)
1733  myWireColorMicroNode.addExplicitInput(
1734  parmMicroNode(i_usedcolor, 0),false);
1735  if(i_dcolor >= 0)
1736  {
1737  myWireColorMicroNode.addExplicitInput(
1738  parmMicroNode(i_dcolor, 0),false);
1739  myWireColorMicroNode.addExplicitInput(
1740  parmMicroNode(i_dcolor, 1),false);
1741  myWireColorMicroNode.addExplicitInput(
1742  parmMicroNode(i_dcolor, 2),false);
1743  }
1744  myWireColorMicroNode.update(t);
1745  }
1746 
1747  use_color = mySetWireColor;
1748  return myWireColor;
1749  }
1750 
1751  void onCreated() override;
1752 
1753 protected:
1754  void checkTimeDependencies(int do_parms=1,
1755  int do_inputs=1,
1756  int do_extras=1) override;
1757 private: // methods
1758  friend class OBJ_UndoPreTransform;
1759 
1760  void evalBLUR(UT_String &result, fpreal now);
1761  void checkKeepPosWhenParenting( OBJ_Node *parent_obj );
1762 
1763  const PRM_Parm * findTransformProperty(
1764  fpreal t, const UT_StringRef &name) const;
1765  PRM_Parm * findTransformProperty(
1766  fpreal t, const UT_StringRef &name);
1767 
1768  template <typename OBJ_NODE, typename VISITOR>
1769  static void visitTransformParms(
1770  OBJ_NODE *node,
1771  fpreal t,
1772  bool exclude_uniform_scale,
1773  VISITOR& visitor);
1774 
1775  bool hasTransformParmChannels(
1776  fpreal t,
1777  bool exclude_uniform_scale) const;
1778 
1779  int evalToggleInt(char *togglename, int toggleindirect,
1780  char *parm, int parmindirect,
1781  fpreal t, int def = 0);
1782  fpreal evalToggleFloat(char *togglename, int toggleindirect,
1783  char *parm, int parmindirect,
1784  fpreal t, fpreal defval = 1);
1785  int evalToggleParm(const char *togglename,
1786  const char *token, fpreal now,
1787  int value);
1788  fpreal evalToggleParm(const char *togglename,
1789  const char *token, fpreal now,
1790  fpreal value);
1791 
1792  void computeSubnetParentTransform(
1793  OP_Context &context,
1794  const UT_ValArray<OBJ_Node *> &parentstack,
1795  UT_DMatrix4 &world_xform);
1796 
1797  void addTransformDependencies( OBJ_Node *subnet );
1798 
1799  void propagateKeepPosWhenMoving();
1800 
1801  void dirtyPreTransform();
1802  void updatePreTransformParms( bool from, bool undo=true);
1803  void updatePreTransformParms( bool from, bool undo, fpreal now, int thread);
1804  void getPreTransformParms( OP_Context &ctx, UT_Matrix4D &mat );
1805 
1806  void applyBackwardsRiTransmitCompatibility(
1807  PRM_ParmList *obsolete_parms);
1808 
1809  const char *inputLabel(unsigned) const override;
1810 
1811  void applyLimits( OP_Context &context, fpreal *t, fpreal *r, fpreal *s );
1812  template<int OFFSET>
1813  void applyLimit( OP_Context &context, fpreal *t );
1814 
1815  void onChangeSpareParms();
1816  void cookLocalXform(OP_Context &context, const UT_DMatrix4 &pmat);
1817 
1818  /// Declares that this node's data depends on the @c op for the given
1819  /// reason (OP_INTEREST_DATA, OP_INTEREST_FLAG).
1820  /// This OBJ override also supports OP_INTEREST_INPUT and redirects it to a call to addOpReference()
1821  /// @note There are no other acceptable values for type.
1822  void addExtraObjInput(OP_Node *op, OP_InterestType type);
1823 
1824  /// All OBJ nodes can be a selection owner.
1825  /// This replaces the previous inheritance from SOP_SelectionOwner.
1826  bool isSelectionOwnerType() const override final
1827  { return true; }
1828 
1829  template<int HAS_DEP>
1830  bool internalGetRawParmTransform(OP_Context &context, UT_DMatrix4 &xform, OBJ_AutoTransformDependencies *in_dep );
1831 
1832 private: // data
1833 
1834 
1835  // Pre H16, myWorldXform and myXform used to be protected.
1836  // When cooking a derived OBJ_Node, use setWorldXform and setLocalXform instead.
1837  UT_DMatrix4 myXform; // Transform in parent's space
1838  UT_DMatrix4 myWorldXform; // Transform in world space
1839  UT_DMatrix4 myIWorldXform; // Inverse Xform in world space
1840 
1841  // myPreTransform is right multiplied into the actual parms version of
1842  // the local object transform when we cook.
1843  // ie. myXform includes myPreTransform after being cooked
1844  UT_DMatrix4 myPreTransform;
1845 
1846  OP_Node *myEvaluatedConstraints;
1847 
1848  // Micro-node for determining when myXform is dirty
1849  class obj_XformMicroNode : public OP_DataMicroNode
1850  {
1851  public:
1852  obj_XformMicroNode(OP_Node &node)
1853  : OP_DataMicroNode(node)
1854  {
1855  }
1856  const char *className() const override
1857  {
1858  return "obj_XformMicroNode";
1859  }
1860  };
1861  obj_XformMicroNode myXformMicroNode;
1862  int myXformCookLevel;
1863 
1864  DEP_MicroNode myModeMicroNode;
1865  DEP_MicroNode myDisplayStyleMicroNode;
1866  DEP_MicroNode myInstanceMicroNode;
1867  UT_StringHolder myInstanceRef;
1868 
1869  int myShopMaterialIndex; // Cache of parm index
1870  uint myShopMaterialIndexLastCheck; // Add/remove count
1871 
1872  unsigned myPreTransformIsIdentity:1,
1873  myTraversingForBlur:1,
1874  mySubnetParentTimeDep:1,
1875  myShowingPreTransform:1,
1876  myUpdatingPreTransform:1,
1877  myInverseDirty:1,
1878  myUseFullTransformModel:1,
1879  myCookingRender:1,
1880  myLimitsFlags:18,
1881  myHasLookAt:1,
1882  myHasPath:1,
1883  myHasConstraints:1,
1884  myPointInstance:1,
1885  myGotConstraintsByFlag:1;
1886 
1887  mutable unsigned myDisplayDisabledBySubnetNeedsUpdate:1,
1888  myDisplayDisabledBySubnet:1,
1889  myInstanceRecursion:1;
1890 
1891  OBJ_NodeFlags myObjFlags;
1892 
1893  // This gets this nodes precedence in display order.
1894  int myDisplayOrder;
1895 
1896  // These variables are for computing the parent xform
1897  UT_ValArray<OP_VERSION> mySubnetParentVersion;
1898  UT_DMatrix4 mySubnetParentTransform;
1899 
1900  enum objLimits
1901  {
1902  MIN_TX = 1<<0,
1903  MIN_TY = 1<<1,
1904  MIN_TZ = 1<<2,
1905  MIN_RX = 1<<3,
1906  MIN_RY = 1<<4,
1907  MIN_RZ = 1<<5,
1908  MIN_SX = 1<<6,
1909  MIN_SY = 1<<7,
1910  MIN_SZ = 1<<8,
1911 
1912  MAX_TX = 1<<9,
1913  MAX_TY = 1<<10,
1914  MAX_TZ = 1<<11,
1915  MAX_RX = 1<<12,
1916  MAX_RY = 1<<13,
1917  MAX_RZ = 1<<14,
1918  MAX_SX = 1<<15,
1919  MAX_SY = 1<<16,
1920  MAX_SZ = 1<<17,
1921  };
1922 
1923  // Pair of Parm* and Long
1924  struct objSpareParam
1925  {
1926  objSpareParam();
1927  objSpareParam( OBJ_Node *obj, const char* name);
1928 
1929  void reset()
1930  {
1931  parm = NULL;
1932  id = -1;
1933  }
1934 
1935  PRM_Parm *parm;
1936  int id;
1937  };
1938  // Struct holding the object spare properties pointers
1939  // for faster access and to only add a pointer to OBJ_Node class.
1940  struct objSpareProperties
1941  {
1942  // returns true if all the Parm pointers are NULL.
1943  // this should be called before disposing of myProperties.
1944  // PLEASE UPDATE when adding new data members
1945  bool isEmpty() const;
1946  void reset();
1947 
1948  // Pre-Transform Category
1949  objSpareParam myPreXOrd;
1950  objSpareParam myPreROrd;
1951  objSpareParam myPreTranslate;
1952  objSpareParam myPreRotate;
1953  objSpareParam myPreScale;
1954 
1955  // Limits Category
1956  objSpareParam myLimitsOn[18];
1957  objSpareParam myLimits[18];
1958 
1959  objSpareParam myParentToBoneTip;
1960  };
1961  objSpareProperties *myProperties;
1962 
1963  UT_Color myWireColor;
1964  bool mySetWireColor;
1965  UT_String myConstraintsChannel;
1966  int myConstraintsChannelIndex;
1967 
1968  DEP_MicroNode myRawParmTransformMicroNode;
1969 
1970  mutable DEP_TimedMicroNode myDisplayMicroNode;
1971  mutable int myCachedDisplay;
1972  mutable DEP_MicroNode myTDisplayMicroNode;
1973  mutable int myCachedTDisplay;
1974 
1975  DEP_TimedMicroNode myWireColorMicroNode;
1976  DEP_TimedMicroNode myObjectStyleMicroNode;
1977  GEO_ViewportLOD myObjectDisplayStyle;
1978 
1979 private: // static data
1980 
1981  static OBJ_KeepPosType ourKeepPosWhenParenting;
1982  static OBJ_KeepPosType ourKeepPosWhenMoving;
1983  static bool ourAllowKeepPos;
1984  static bool ourIgnorePretransformValue;
1985  static bool ourAllowIgnorePretransform;
1986 };
1987 
1988 inline bool
1990 {
1991  return (evalIntT("caching", &getIndirect()[I_CACHING], 0, 0, thread) != 0);
1992 }
1993 
1994 inline bool
1996 {
1998 
1999  // the intercept mode is used by some CHOPs to map the current time
2000  // beyond the frame limits. In this case we cannot guarantee that
2001  // caching a matrix at frame, say, 2 and then after one play cycle
2002  // again at frame 2 (which is sort of frame 302) is refering to the
2003  // same xform (assuming 1..300 range). In these situatin we turn off
2004  // caching.
2005  // NB: the intercept mode is entered via SCROLL LOCK key
2006 
2007  return (mode != 1) && getCachable(thread);
2008 }
2009 
2010 #undef FLOAT_OBJ_PARM
2011 #undef FLOAT_OBJ_PARMS
2012 #undef INT_OBJ_PARM
2013 #undef STR_OBJ_PARM
2014 
2015 #undef SET_FLOAT
2016 #undef SET_INT
2017 #undef SET_STRING
2018 
2019 extern "C" {
2021 };
2022 
2024 {
2025 public:
2027 
2029  const OBJ_AutoTransformDependencies &ctx) = delete;
2030  OBJ_AutoTransformDependencies &operator=(
2031  const OBJ_AutoTransformDependencies &ctx) = delete;
2032 
2034  {
2035  resetUserData();
2036  }
2037 
2039  {
2040  if( myCallerUserData )
2041  {
2042  if( myExtraInputs.size() )
2043  myCaller->addExtraInputs( myExtraInputs );
2044 
2045  if( myExtraMicroNodes.size() )
2046  myCaller->addExtraInputs( myExtraMicroNodes );
2047 
2048 
2049  myContext.setData(myCallerUserData);
2050 
2051  myCaller = nullptr;
2052  myCallerUserData = nullptr;
2053  myCallerTransformUserData = nullptr;
2054  }
2055  }
2056 
2058  {
2059  if( !myCaller || !dep )
2060  return;
2061 
2062  myExtraMicroNodes.append( dep );
2063 
2064  // Force time dependency from time dependent parameters
2065  if( myAddTimeDep )
2066  {
2067  if( !myCaller->flags().getTimeDep() && dep->inheritTimeDependentFromExplicitInputs() )
2068  {
2069  myCaller->flags().setTimeDep(true);
2070  }
2071  }
2072  }
2073 
2075  {
2076  if( !myCaller || !src )
2077  return;
2078 
2079  // If the node is being deleted, then don't add it to our extra inputs, or
2080  // else we will get end up getting a dangling reference.
2081  if (src->isBeingDeleted())
2082  {
2083  // The UT_ASSERT() here makes it easier to be aware of these situations
2084  // but in general, the user can produce these situations easily because
2085  // channel references can be evaluated right away which then cause them
2086  // to attempt to add an extra input on the node being deleted.
2087  UT_ASSERT(!"Adding an extra input onto a deleted node");
2088  return;
2089  }
2090 
2091  ((OBJ_Node*)myCaller)->addExtraObjInput(src, type);
2092  }
2093 
2094  void addExtraInput( OP_Node *src, int pi, int vi=0 )
2095  {
2096  addExtraInput( src, pi, vi, vi);
2097  }
2098 
2099  void addExtraInput( OP_Node *src, int pi, int vi_start, int vi_end )
2100  {
2101  if( !myCaller || !src )
2102  return;
2103 
2104  // If the node is being deleted, then don't add it to our extra inputs, or
2105  // else we will get end up getting a dangling reference.
2106  if (src->isBeingDeleted())
2107  {
2108  // The UT_ASSERT() here makes it easier to be aware of these situations
2109  // but in general, the user can produce these situations easily because
2110  // channel references can be evaluated right away which then cause them
2111  // to attempt to add an extra input on the node being deleted.
2112  UT_ASSERT(!"Adding an extra input onto a deleted node");
2113  return;
2114  }
2115 
2116  for( int vi=vi_start; vi<=vi_end; ++vi )
2117  {
2118  myExtraInputs.append( OP_InterestRef(*src,pi,vi) );
2119  }
2120 
2121  // Force time dependency from time dependent parameters
2122  if( myAddTimeDep )
2123  {
2124  if( !myCaller->flags().getTimeDep() &&src->getParmList()->getTimeDependent() )
2125  {
2126  PRM_Parm *p = src->getParmList()->getParmPtr(pi);
2127  if( p )
2128  {
2129  for( int vi=vi_start; vi<=vi_end; ++vi )
2130  {
2131  if( p->isTimeDependent(vi) )
2132  {
2133  myCaller->flags().setTimeDep(true);
2134  break;
2135  }
2136  }
2137  }
2138  }
2139  }
2140  }
2141 
2142  bool hasCaller() const { return myCaller;}
2143  bool getExtraArgs( int &xord, int &rord, int &mask)
2144  {
2145  if( myCallerTransformUserData )
2146  return myCallerTransformUserData->getExtraArgs(xord,rord,mask);
2147  return false;
2148  }
2149 
2150 
2151 private:
2152  OP_Context &myContext;
2153  OP_ContextData *myCallerUserData;
2154  OP_TransformContextData *myCallerTransformUserData;
2155  OP_Node *myCaller;
2156  bool myAddTimeDep;
2159 };
2160 #endif
void setRGB(UT_Vector3F c)
void addWarning(OBJ_Error code, const char *msg=0)
Definition: OBJ_Node.h:1339
UT_DMatrix4 & getPreTransform()
Definition: OBJ_Node.h:686
virtual bool getTimeOverride()
Definition: OBJ_Node.h:1416
void setTX(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1455
virtual OBJ_Bone * castToOBJBone()
Definition: OBJ_Node.h:999
const UT_Matrix4D & getLocalXform() const
Definition: OBJ_Node.h:1438
GT_API const UT_StringHolder selection
#define SET_FLOAT(name, parm_index, vector_index, t, val, add_key)
Definition: OBJ_Node.h:225
virtual bool getParameterOrProperty(const UT_StringRef &name, fpreal now, OP_Node *&op, PRM_Parm *&parm, bool create_missing_multiparms, PRM_ParmList *obsolete=0)
OBJ_SHADER_LOCATION
Definition: OBJ_Node.h:123
virtual bool updateParmsFlags()
PRM_AddKeyType
Definition: PRM_Parm.h:58
GLbitfield flags
Definition: glcorearb.h:1596
int PATHPARMTYPE(fpreal t)
Definition: OBJ_Node.h:1522
OBJ_ParmsStyle
Definition: OBJ_Node.h:207
DOP_Node * getDisplayDopPtr()
Definition: OBJ_Node.h:706
void R(fpreal *v, fpreal t)
Definition: OBJ_Node.h:1503
virtual OBJ_Sticky * castToOBJSticky()
Definition: OBJ_Node.h:1009
fpreal getH() const override
Node position/scale is used by the UI.
PRM_Parm * getParmPtr(const UT_StringRef &theparmname, int &theparmidx)
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2545
virtual OBJ_DopNet * castToOBJDopNet()
Definition: OBJ_Node.h:1001
fpreal getW() const override
Node position/scale is used by the UI.
void T(fpreal *v, fpreal t)
Definition: OBJ_Node.h:1502
#define SYS_DEPRECATED(__V__)
virtual int VPORT_SHADEOPEN()
Definition: OBJ_Node.h:1536
static const char * theChildTableName
Definition: OBJ_Node.h:240
static const char * boundingBoxToken
Definition: OBJ_Node.h:975
Unsorted map container.
Definition: UT_Map.h:107
uint64 OP_VERSION
Definition: OP_Version.h:6
OBJ_TransformComponent
Definition: OBJ_Node.h:1293
virtual int isObjectLitBySubnet(OBJ_Node *, fpreal)
Definition: OBJ_Node.h:957
void setPIVOTRZ(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1485
void setSCALE(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1488
void addFatal(OBJ_Error code, const char *msg=0)
Definition: OBJ_Node.h:1341
Definition: OBJ_Node.h:155
void setDCOLORB(fpreal t, fpreal b)
Definition: OBJ_Node.h:1575
const char * getDefaultedSProperty(const char *name, fpreal now, UT_String &result, const char *def) const
Definition: OBJ_Node.h:1692
#define SYS_VISIBILITY_EXPORT
void
Definition: png.h:1083
void setIsPreTransformIdentity(int yesno)
Definition: OBJ_Node.h:690
void addExtraInput(OP_Node *src, OP_InterestType type=OP_INTEREST_DATA)
Definition: OBJ_Node.h:2074
fpreal PATHBANK(fpreal t)
Definition: OBJ_Node.h:1527
const GLdouble * v
Definition: glcorearb.h:837
int parmIndexCONSTRAINTSPATH() const
Definition: OBJ_Node.h:1626
bool getExtraArgs(int &xord, int &rord, int &mask)
Definition: OBJ_Node.h:2143
virtual bool getPickable()
Definition: OP_Node.h:1341
void setSZ(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1471
virtual void setFlag(char tag, int8 val)
Transformation order of scales, rotates, and translates.
Definition: UT_XformOrder.h:23
void setDisplayOrder(int order)
Definition: OBJ_Node.h:1666
static const char * input2ObjectToken
Definition: OBJ_Node.h:978
void P(fpreal *v, fpreal t)
Definition: OBJ_Node.h:1505
virtual bool createSpareParametersForLoad(UT_StringArray &, PRM_ParmNameMap &, UT_String &)
int LOOKAT(UT_String &str, fpreal t) const
Definition: OBJ_Node.h:1636
UT_API UT_ErrorSeverity UTaddFatal(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
virtual OBJ_StereoCamera * castToOBJStereoCamera()
Definition: OBJ_Node.h:1011
#define SYS_DEPRECATED_HDK_REPLACE(__V__, __R__)
const GLuint GLenum const void * binary
Definition: glcorearb.h:1924
virtual int doDrawLit() const
Definition: OBJ_Node.h:971
void addExtraInput(OP_Node *src, int pi, int vi=0)
Definition: OBJ_Node.h:2094
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
bool isCachingTransforms(int thread) const
Definition: OBJ_Node.h:1995
int PICKING()
Definition: OBJ_Node.h:1529
GA_API const UT_StringHolder rot
virtual OBJ_Blend * castToOBJBlend()
Definition: OBJ_Node.h:998
GLboolean GLboolean g
Definition: glcorearb.h:1222
virtual const char * getSetRotateParmName() const
Definition: OBJ_Node.h:944
GLdouble s
Definition: glad.h:3009
UT_ErrorSeverity
Definition: UT_Error.h:25
bool evalVariableValue(UT_String &val, int index, int thread) override
Definition: OBJ_Node.h:250
Parameters for OP_Node::getInfoText()/OP_Node::getNodeSpecificInfoText()
virtual const char * getSetScaleParmName() const
Definition: OBJ_Node.h:943
virtual bool getDisplayOrigin() const
Definition: OP_Node.h:1349
void setParentingErrorFlag(bool o)
Definition: OBJ_Node.h:820
Definition: OBJ_Node.h:156
int USE_DCOLOR()
Definition: OBJ_Node.h:1555
int PATHSOP(UT_String &str, fpreal t) const
Definition: OBJ_Node.h:1648
static const char * input3ObjectToken
Definition: OBJ_Node.h:979
int LOOKUPOBJ(UT_String &str, fpreal t) const
Definition: OBJ_Node.h:1642
**But if you need a result
Definition: thread.h:613
virtual void getParallelInputs(OP_Context &context, OP_NodeList &nodes) const
static void setGlobalKeepPosWhenParenting(OBJ_KeepPosType flag)
Definition: OBJ_Node.h:865
virtual OBJ_Fog * castToOBJFog()
Definition: OBJ_Node.h:1003
virtual void getNodeSpecificInfoText(OP_Context &context, OP_NodeInfoParms &parms)
UT_API UT_ErrorSeverity UTaddMessage(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
float fpreal32
Definition: SYS_Types.h:200
void PICKSCRIPT(UT_String &str, fpreal t)
Definition: OBJ_Node.h:1530
UT_Color DCOLOR(fpreal t)
Definition: OBJ_Node.h:1562
int XYZ(fpreal t) const
Definition: OBJ_Node.h:1499
virtual int VPORT_DISPLAYASSUBDIV()
Definition: OBJ_Node.h:1537
void setSX(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1467
fpreal getDefaultedFProperty(const char *name, fpreal now, fpreal def) const
Definition: OBJ_Node.h:1685
OBJ_BaseIndex
Definition: OBJ_Node.h:148
static const char * renderSopToken
Definition: OBJ_Node.h:974
void S(fpreal *v, fpreal t)
Definition: OBJ_Node.h:1504
static const char * displaySopToken
Definition: OBJ_Node.h:973
SOP_Node * getDisplaySopPtr()
Definition: OBJ_Node.h:702
OBJ_VariableId
Definition: OBJ_Node.h:191
const UT_Color & DCOLORREF(fpreal t, int &use_color)
Definition: OBJ_Node.h:1715
const char * getDefaultedRawSProperty(const char *name, fpreal now, UT_String &result, const char *def) const
Definition: OBJ_Node.h:1699
const OP_DataMicroNode & dataMicroNodeConst() const override
Definition: OBJ_Node.h:1087
#define FLOAT_OBJ_PARMS(name, idx, v, t)
Definition: OBJ_Node.h:218
GLdouble n
Definition: glcorearb.h:2008
obj_PathParmType
Definition: OBJ_Node.h:1515
static void setGlobalKeepPosWhenMoving(OBJ_KeepPosType flag)
Definition: OBJ_Node.h:870
int isTimeDependent() const
virtual bool isLightInLightMask(const OBJ_Node *light, fpreal now)
Function to resolve lighting based on light masks.
Definition: OBJ_Node.h:953
virtual const OP_DataMicroNode & parmListMicroNodeConst() const
Definition: OP_Node.h:1605
OP_InterestType
Definition: OP_DataTypes.h:44
obj_OnionSkin
Definition: OBJ_Node.h:726
void addExtraInput(OP_Node *src, int pi, int vi_start, int vi_end)
Definition: OBJ_Node.h:2099
GLboolean reset
Definition: glad.h:5138
int KEEPPOS(fpreal t) const
Definition: OBJ_Node.h:1497
virtual int * getIndirect() const =0
fpreal DCOLORR(fpreal t)
Definition: OBJ_Node.h:1558
void PIVOTR(fpreal *v, fpreal t)
Definition: OBJ_Node.h:1506
Definition: OBJ_Node.h:154
int TRS(fpreal t) const
Definition: OBJ_Node.h:1498
GA_API const UT_StringHolder trans
void setDCOLORR(fpreal t, fpreal r)
Definition: OBJ_Node.h:1571
void LOOKUP(UT_String &str, fpreal t)
Definition: OBJ_Node.h:1511
virtual OP_ERROR setInput(unsigned idx, OP_Node *op, unsigned outputIdx=0)
Sets a given input to connect to an output of a particular node.
OBJ_Error
Definition: OBJ_Error.h:15
SYS_FORCE_INLINE bool getTimeDependent() const
Definition: PRM_ParmList.h:309
#define SET_INT(name, parm_index, vector_index, t, val)
Definition: OBJ_Node.h:227
int getInterceptMode() const
Definition: UT_Playback.h:84
int getCachedParmIndex(const UT_StringRef &name, int name_idx) const
Definition: OBJ_Node.h:1388
virtual OP_ERROR setNamedInput(const OP_ConnectorId &input_name, OP_Node *op, const OP_ConnectorId *output_name=nullptr)
New input functions that use names instead of indices.
void opChanged(OP_EventType reason, void *data=0) override
static OBJ_KeepPosType getGlobalKeepPosWhenMoving()
Definition: OBJ_Node.h:872
virtual bool setPickable(bool on_off)
Definition: OP_Node.h:1297
int getCachedParmIndex(const PRM_Name &name, int name_idx) const
Definition: OBJ_Node.h:1396
virtual bool getHideDefaultParms() const
Definition: OBJ_Node.h:1074
void addError(int code, const char *msg=0)
Definition: OBJ_Node.h:1335
GLint GLuint mask
Definition: glcorearb.h:124
void setTY(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1457
int PATHORIENT(fpreal t)
Definition: OBJ_Node.h:1523
void setSY(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1469
OBJ_KeepPosType
Definition: OBJ_Node.h:198
int parmIndexDISPLAY() const
Definition: OBJ_Node.h:1580
virtual const char * getSetTranslateParmName() const
Definition: OBJ_Node.h:945
GLdouble GLdouble GLint GLint order
Definition: glad.h:2676
long long int64
Definition: SYS_Types.h:116
SYS_VISIBILITY_EXPORT void newObjectOperator(OP_OperatorTable *table)
Definition: OBJ_Lamp.C:40
fpreal PATHROLL(fpreal t)
Definition: OBJ_Node.h:1524
virtual OBJ_Ambient * castToOBJAmbient()
Definition: OBJ_Node.h:997
int parmIndexTDISPLAY() const
Definition: OBJ_Node.h:1616
void addMessage(OBJ_Error code, const char *msg=0)
Definition: OBJ_Node.h:1337
GLuint id
Definition: glcorearb.h:655
#define FLOAT_OBJ_PARM(name, idx, vi, t)
Definition: OBJ_Node.h:216
#define INT_OBJ_PARM(name, idx, vi, t)
Definition: OBJ_Node.h:220
int PROMOTE_POPGUIDES(fpreal t) const
Definition: OBJ_Node.h:1656
void addExtraInput(DEP_MicroNode *dep)
Definition: OBJ_Node.h:2057
OP_OpTypeId
Definition: OP_OpTypeId.h:18
void setLocalXform(const UT_Matrix4D &m)
Definition: OBJ_Node.h:1442
virtual OBJ_Camera * castToOBJCamera()
Definition: OBJ_Node.h:1000
virtual OP_Node * getRenderNodePtr()
static void setIgnorePretransformValue(bool flag)
Definition: OBJ_Node.h:881
bool hasConstraints() const
Definition: OBJ_Node.h:1112
virtual bool getParameterOrPropertyByChannel(const UT_StringRef &chname, fpreal now, OP_Node *&op, PRM_Parm *&parm, int &vector_index, PRM_ParmList *obsolete=0)
virtual OBJ_SubNet * castToOBJSubNet()
Definition: OBJ_Node.h:1010
GLuint const GLchar * name
Definition: glcorearb.h:786
void setCHILDCOMP(int v)
Definition: OBJ_Node.h:1495
signed char int8
Definition: SYS_Types.h:35
void setTZ(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1459
GLsizei const GLchar *const * strings
Definition: glcorearb.h:1933
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
static bool getIgnorePretransform()
Definition: OBJ_Node.h:883
virtual const OP_DataMicroNode & dataMicroNodeConst() const
Definition: OP_Node.h:1594
virtual bool getBoundingBox(UT_BoundingBox &box, OP_Context &)
void setROTORDER(int v)
Definition: OBJ_Node.h:1493
int CHILDCOMP(fpreal t) const
Definition: OBJ_Node.h:1500
fpreal DCOLORB(fpreal t)
Definition: OBJ_Node.h:1560
GLenum GLenum GLsizei void * table
Definition: glad.h:5129
OBJ_UIChangeType
Definition: OBJ_Node.h:131
virtual OP_OpTypeId getOpTypeID() const
Definition: OP_Node.h:525
static const char * input4ObjectToken
Definition: OBJ_Node.h:980
const UT_Matrix4D & getWorldXform() const
Definition: OBJ_Node.h:1446
GLdouble t
Definition: glad.h:2397
bool getObjectDisplay(fpreal t, const OP_Network *n=0) const
Definition: OBJ_Node.h:1588
GLenum mode
Definition: glcorearb.h:99
virtual OP_ERROR setNamedIndirectInput(const OP_ConnectorId &input_name, OP_IndirectInput *input)
bool getParentingErrorFlag() const
Definition: OBJ_Node.h:818
virtual bool createSpareParametersFromChannels(UT_BitArray &selection, const CH_ChannelList &channels)
int CACHING()
Definition: OBJ_Node.h:1532
virtual OBJ_Light * castToOBJLight()
Definition: OBJ_Node.h:1006
fpreal PATHPOS(fpreal t)
Definition: OBJ_Node.h:1521
virtual OP_ERROR setNamedInputReference(const OP_ConnectorId &input_name, const char *label, int, const OP_ConnectorId *output_name=nullptr)
virtual void getDragDropChoice(DD_Source &src, DD_ChoiceList &c)
int isPreTransformIdentity()
Definition: OBJ_Node.h:688
virtual const char * getChildType() const
#define STR_OBJ_PARM(name, idx, vi, t)
Definition: OBJ_Node.h:222
GLsizeiptr size
Definition: glcorearb.h:664
virtual int testDragDrop(DD_Source &src)
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
GLuint shader
Definition: glcorearb.h:785
A map of string to various well defined value types.
Definition: UT_Options.h:84
void setWorldXform(const UT_Matrix4D &m)
Definition: OBJ_Node.h:1451
void setRY(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1463
virtual int findParametersOrProperties(fpreal now, OP_PropertyLookupList &list)
Parameters for OP_Node::fillInfoTree()/OP_Node::fillInfoTreeNodeSpecific()
void PATHUP(fpreal *v, fpreal t)
Definition: OBJ_Node.h:1525
virtual void fillInfoTreeNodeSpecific(UT_InfoTree &tree, const OP_NodeInfoTreeParms &parms)
virtual bool canCreateNewOpType() const
UT_ColorType
Definition: UT_Color.h:24
PRM_Parm * getCachedParm(const UT_StringRef &name, int name_idx)
Definition: OBJ_Node.h:1404
static OBJ_KeepPosType getGlobalKeepPosWhenParenting()
Definition: OBJ_Node.h:867
int getDisplayOrder() const
Definition: OBJ_Node.h:1662
static UT_Playback * getPlayback()
GEO_ViewportLOD
virtual int isObjectLitBy(OBJ_Node *, fpreal)
Definition: OBJ_Node.h:951
GA_API const UT_StringHolder up
virtual void resolveObsoleteParms(PRM_ParmList *)
OP_VERSION modVersion() const
fpreal64 fpreal
Definition: SYS_Types.h:277
exint evalIntT(int pi, int vi, fpreal t, int thread) const
SOP_Node * getRenderSopPtr()
Definition: OBJ_Node.h:704
virtual OP_ERROR setIndirectInput(unsigned idx, OP_IndirectInput *input)
Connects an input to an indirect input of our parent subnet.
bool isUseFullTransformModel() const
Definition: OBJ_Node.h:312
virtual OBJ_Rivet * castToOBJRivet()
Definition: OBJ_Node.h:1008
OBJ_MatchTransform
Definition: OBJ_Node.h:137
void setPIVOTRY(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1482
GLuint index
Definition: glcorearb.h:786
int getDefaultedIProperty(const char *name, fpreal now, int def) const
Definition: OBJ_Node.h:1678
virtual void referencedParmChanged(int pi)
virtual bool setDisplayOrigin(bool on_off_unchanged)
Definition: OP_Node.h:1305
virtual const char * getOpType() const
UT_API UT_ErrorSeverity UTaddWarning(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
int parmIndexCONSTRAINTSON() const
Definition: OBJ_Node.h:1621
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
GLuint GLfloat * val
Definition: glcorearb.h:1608
OP_EventType
Definition: OP_Value.h:22
void setRZ(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1465
GA_API const UT_StringHolder pivot
OP_DataType
Definition: OP_DataTypes.h:28
virtual OP_OpTypeId getChildTypeID() const =0
virtual OBJ_Handle * castToOBJHandle()
Definition: OBJ_Node.h:1005
int invert(T tol=0.0F)
void setTRANSORDER(int v)
Definition: OBJ_Node.h:1492
virtual bool evalVariableValue(UT_String &val, int index, int thread)
constexpr T pi()
Pi constant taken from Boost to match old behaviour.
Definition: Math.h:119
const OP_DataMicroNode & parmListMicroNodeConst() const override
Definition: OBJ_Node.h:1080
bool isstring() const
Definition: UT_String.h:691
bool inheritTimeDependentFromExplicitInputs()
OBJ_MOTIONBLUR_TYPE
Definition: OBJ_Node.h:115
virtual OBJ_Fetch * castToOBJFetch()
Definition: OBJ_Node.h:1002
int isBeingDeleted() const
Definition: OP_Node.h:1413
const UT_DMatrix4 & getInverseXform()
Definition: OBJ_Node.h:1422
This is the base class for all DOP nodes.
Definition: DOP_Node.h:77
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
static bool getIgnorePretransformValue()
Definition: OBJ_Node.h:886
void setPX(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1473
void setPZ(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1477
GLboolean r
Definition: glcorearb.h:1222
#define const
Definition: zconf.h:214
bool getCachable(int thread) const
Definition: OBJ_Node.h:1989
virtual void propagateEndBlockModify()
void setRX(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1461
#define OBJ_API
Definition: OBJ_API.h:10
fpreal SCALE(fpreal t)
Definition: OBJ_Node.h:1509
SYS_FORCE_INLINE PRM_ParmList * getParmList()
Definition: PRM_ParmOwner.h:71
type
Definition: core.h:1059
OP_VERSION parmListModVersion() const
Definition: OBJ_Node.h:1082
void setPY(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1475
virtual OBJ_Null * castToOBJNull()
Definition: OBJ_Node.h:1007
OBJ_NodeFlags & objflags()
Definition: OBJ_Node.h:829
unsigned int uint
Definition: SYS_Types.h:45
void setCookingRender(int val) override
Definition: OBJ_Node.h:826
void setDCOLORG(fpreal t, fpreal g)
Definition: OBJ_Node.h:1573
void setPIVOTRX(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1479
static const char * boundingSphereToken
Definition: OBJ_Node.h:976
virtual int acceptDragDrop(DD_Source &src, const char *label)
Definition: OBJ_Node.h:153
virtual OBJ_Geometry * castToOBJGeometry()
Definition: OBJ_Node.h:1004
Definition: format.h:895
static const char * input1ObjectToken
Definition: OBJ_Node.h:977
virtual OP_Node * getDisplayNodePtr()
int isCookingRender() const override
Definition: OBJ_Node.h:823
fpreal DCOLORG(fpreal t)
Definition: OBJ_Node.h:1559
OP_ERROR setParentObject(OBJ_Node *node)
Definition: OBJ_Node.h:1349
UT_API UT_ErrorSeverity UTaddError(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
OBJ_OBJECT_TYPE
Definition: OBJ_Node.h:73
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)
const PRM_Parm * getCachedParm(const UT_StringRef &name, int name_idx) const
Definition: OBJ_Node.h:1409
virtual obj_OnionSkin getOnionSkin()
Definition: OBJ_Node.h:732
void setKEEPPOS(int v)
Definition: OBJ_Node.h:1494
void setDisplayDisabledBySubnetNeedsUpdate()
Definition: OBJ_Node.h:1673
GLenum src
Definition: glcorearb.h:1793
virtual OP_ERROR setInputReference(unsigned idx, const char *label, int keeppos, unsigned outputIdx=0)
Connects an input to particular node by name in the network.