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