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