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  virtual const char *getChildType() const override;
237  virtual const char *getOpType() const override;
238 
239  virtual OP_OpTypeId getChildTypeID() const override;
240  virtual 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 
247  virtual bool evalVariableValue(fpreal &val,
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.
267  virtual void resolveObsoleteParms(
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  virtual bool getWorldTransform(UT_Matrix4D &mat,
495  OP_Context &context) override;
496  virtual bool getIWorldTransform(UT_Matrix4D &mat,
497  OP_Context &context) override;
498  virtual bool getTransform( TransformMode mode, UT_Matrix4D &mat,
499  OP_Context &context) override;
500  virtual int getRelativeTransform(OP_Node &to,
501  UT_Matrix4 &xform,
502  OP_Context &context) override;
503  virtual 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  virtual 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  virtual 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  virtual int setPickable(int onOff) override;
691  virtual int getPickable() override;
692  int setCachable(int onOff);
693  int getCachable(int thread) const;
694  virtual int setFlag(char flag, int onoff) override;
695 
696  virtual 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  virtual int getDisplayOrigin() const override;
807  virtual int setDisplayOrigin(int on_off_unchanged) override;
808 
810  { return myObjFlags.getParentingErrorFlag(); }
812  { myObjFlags.setParentingErrorFlag(o); }
813 
814  virtual int isCookingRender() const override
815  { return myCookingRender ? 1:0; }
816 
817  virtual void setCookingRender(int val) override
818  { myCookingRender = (val!=0); }
819 
820  OBJ_NodeFlags &objflags() { return myObjFlags; }
821 
822  virtual OP_ERROR setInput(
823  unsigned idx, OP_Node *op,
824  unsigned outputIdx = 0) override;
825 
826  virtual OP_ERROR setInputReference(
827  unsigned idx, const char *label,
828  int keeppos,
829  unsigned outputIdx = 0) override;
830 
831  virtual OP_ERROR setIndirectInput(
832  unsigned idx,
833  OP_IndirectInput *in) override;
834 
835  virtual 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  virtual 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  virtual void opChanged(OP_EventType reason,
881  void *data=0) override;
882  virtual 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 
974  OP_NodeInfoParms &iparms) override;
975  virtual void fillInfoTreeNodeSpecific(UT_InfoTree &tree,
976  const OP_NodeInfoTreeParms &parms) override;
977 
978  virtual void propagateEndBlockModify() override;
979 
980  //Absolute Width
981  virtual fpreal getW() const override;
982  //Absolute Height
983  virtual fpreal getH() const override;
984 
985 
986  virtual OBJ_Ambient *castToOBJAmbient() { return NULL; }
987  virtual OBJ_Blend *castToOBJBlend() { return NULL; }
988  virtual OBJ_Bone *castToOBJBone() { return NULL; }
989  virtual OBJ_Camera *castToOBJCamera() { return NULL; }
990  virtual OBJ_DopNet *castToOBJDopNet() { return NULL; }
991  virtual OBJ_Fetch *castToOBJFetch() { return NULL; }
992  virtual OBJ_Fog *castToOBJFog() { return NULL; }
993  virtual OBJ_Geometry*castToOBJGeometry() { return NULL; }
994  virtual OBJ_Handle *castToOBJHandle() { return NULL; }
995  virtual OBJ_Light *castToOBJLight() { return NULL; }
996  virtual OBJ_Null *castToOBJNull() { return NULL; }
997  virtual OBJ_Rivet *castToOBJRivet() { return NULL; }
998  virtual OBJ_Sticky *castToOBJSticky() { return NULL; }
999  virtual OBJ_SubNet *castToOBJSubNet() { return NULL; }
1000  virtual OBJ_StereoCamera* castToOBJStereoCamera() { return NULL; }
1001 
1002  // Build a shader string for the object. If the shader string is built
1003  // successfully, the SHOP which generated the string will be returned.
1004  bool assignShader(int shop_type, const char *path,
1005  OBJ_SHADER_LOCATION where);
1006  OP_Node *evalShaderString(UT_String &shader, int shop_type, fpreal now,
1007  const UT_Options *options, OP_Node *shader_node = 0);
1008  bool evalShaderHandle(UT_String &handle, int shop_type, fpreal now,
1009  const UT_Options *options, OP_Node *shader_node = 0);
1010  bool evalShaderLanguage(UT_String &lang, int shop_type, fpreal now,
1011  const UT_Options *options, OP_Node *shader_node = 0);
1012  OP_Node *evalShaderData(SHOP_ReData &data, int shop_type, fpreal now,
1013  const UT_Options *options, OP_Node *shader_node = 0);
1014  OP_Node *evalShaderBounds(UT_BoundingBox &box, int shop_type,fpreal now,
1015  const UT_Options *options, OP_Node *shader_node = 0);
1016  bool evalCoShaderStrings(UT_StringArray &strings,
1017  OP_NodeList &shops, int shop_type, fpreal now,
1018  const UT_Options *options, OP_Node *shader_node = 0);
1019  bool evalCoShaderHandles(UT_StringArray &handles,
1020  int shop_type, fpreal now,
1021  const UT_Options *options, OP_Node *shader_node = 0);
1022  bool evalCoShaderLanguages(UT_StringArray &languages,
1023  int shop_type, fpreal now,
1024  const UT_Options *options, OP_Node *shader_node = 0);
1025  void getShopTransform(UT_DMatrix4 &xform, int shop_type,
1026  fpreal now, const UT_Options *options);
1027 
1028  // Returns the token (name) of the material parameter.
1029  static const char *getMaterialParmToken();
1030 
1031  // Get a node specified as a material
1032  OP_Node *getMaterialNode( fpreal now );
1033 
1034  // Get a particular SHOP.
1035  OP_Node *getShaderNode(OP_Node *candidate, int shader_type,
1036  fpreal now, const UT_Options *options);
1037  OP_Node *getShaderNode(int shader_type, fpreal now,
1038  const UT_Options *options,
1039  DEP_MicroNode *dep = NULL);
1040 
1041  // Load up the options with the local parameter defintions
1042  virtual const UT_Options *createShaderParms(OP_Options &options,
1043  fpreal now,
1044  const UT_Options *src);
1045 
1046  // Combine the SOPs of other objects into this one. On success, returns
1047  // the display_merge SOP pointer, else NULL.
1048  //
1049  // objs List of objects to combine. These will be deleted on
1050  // return.
1051  // full_combine If true, it performs a combine with the existing SOPs
1052  // inside this object.
1053  // moved_map Optional. On return, this filled with a map of the
1054  // child node pointers from source node pointer to
1055  // destination node pointer.
1056  OP_Node *combine(OP_Context &context,
1057  const UT_ValArray<OBJ_Node *> &objs,
1058  bool full_combine = true,
1059  UT_Map<OP_Node *, OP_Node *> *moved_map = NULL);
1060 
1061  virtual bool getHideDefaultParms() const
1062  { return false; }
1063 
1064  virtual bool canCreateNewOpType() const override;
1065 
1066  virtual const OP_DataMicroNode &
1067  parmListMicroNodeConst() const override
1068  { return myXformMicroNode; }
1070  { return parmListMicroNodeConst().modVersion(); }
1071 
1072  // myXformCookLevel is positive during the cook of myXform
1073  virtual const OP_DataMicroNode &
1074  dataMicroNodeConst() const override
1075  {
1076  return (myXformCookLevel > 0)
1077  ? myXformMicroNode
1079  }
1080 
1081  // Set Parm Transform that can trigger notifications
1082  bool setParmTransform( OP_Context &context, const UT_DMatrix4 &xform,
1083  bool create_keys,
1084  bool fail_if_any_locked_parms,
1085  bool change_locked_parms,
1086  const UT_Vector3R *rotate_vals,
1087  bool check_modified
1088  );
1089  // Set Parm Pivot Transform that can trigger notifications
1090  bool setParmPivotTransform( OP_Context &context,
1091  const UT_DMatrix4 &xform,
1092  bool create_keys,
1093  bool fail_if_any_locked_parms,
1094  bool change_locked_parms,
1095  const UT_Vector3R *rotate_vals,
1096  bool check_modified
1097  );
1098 
1099  bool hasConstraints() const { return myHasConstraints; }
1100 
1101  bool getRawParmTransform(OP_Context &context, UT_DMatrix4 &xform );
1102  bool getRawParmTransform(OP_Context &context, UT_Matrix4 &xform );
1103 protected:
1104 
1105  OBJ_Node(OP_Network *parent, const char *name, OP_Operator *op);
1106  virtual ~OBJ_Node();
1107 
1108  bool supportsDropShopType(int shop_type);
1109  virtual int acceptDragDrop(DD_Source &src,
1110  const char *label) override;
1111 
1112  virtual int testDragDrop(DD_Source &src) override;
1113  virtual void getDragDropChoice(DD_Source &src,
1114  DD_ChoiceList &c) override;
1115 
1116 
1117  // This method should add any extra interests that an object might
1118  // have. By default, geo instance, particle instance, shader spaces
1119  // etc. are added. This is called when objects cook.
1120  virtual void addExtraDependencies(OP_Context &context);
1121  virtual int getOpShadingInfo(UT_String &str, fpreal t);
1122  virtual int getOpConstraintsInfo(UT_String &str, fpreal t);
1123  virtual bool createSpareParametersFromChannels(
1125  const CH_ChannelList &channels) override;
1127  PRM_ParmNameMap &nmap,
1128  UT_String &errors) override;
1129  virtual bool getParameterOrProperty(
1130  const UT_StringRef &name, fpreal now,
1131  OP_Node *&op, PRM_Parm *&parm,
1132  bool create_missing_multiparms,
1133  PRM_ParmList *obsolete = 0) override;
1134  virtual bool getParameterOrPropertyByChannel(
1135  const UT_StringRef &name,
1136  fpreal now,
1137  OP_Node *&op, PRM_Parm *&parm, int &vectoridx,
1138  PRM_ParmList *obsolete = 0) override;
1139  virtual int findParametersOrProperties(fpreal now,
1140  OP_PropertyLookupList &list) override;
1141 
1142  /// Computes and pre-multiplies an input dependent matrix to the given
1143  /// current matrix. This transform is
1144  /// defined as semantically dependent on the object's inputs. The OBJ_Blend
1145  /// object overrides this to do special processing. Also, the OBJ_Bone
1146  /// object overrides this to move its origin to the tip of the parent bone.
1147  /// By default, this method does not modify the given matrix, which is
1148  /// equivalent to identity matrix.
1149  /// @param context The cook context, which contains the time.
1150  /// @param mat Input and output parameter, that gets premuliplied by
1151  // the computed input dependent transform matrix, if any.
1152  ///
1153  /// @return Returns 1 if the matrix was modified, 0 otherwise
1154  virtual int applyInputDependentTransform(
1155  OP_Context &context, UT_DMatrix4 &mat);
1156 
1157  /// Computes and pre-multiplies an input independent transform to
1158  /// the given matrix.
1159  /// This transform is defined as semantically independent of the
1160  /// object's inputs. The default implementation applies a follow path
1161  /// object transform, if available.
1162  ///
1163  /// @param context The cook context, which contains the time.
1164  /// @param mat Input and output parameter, that gets premuliplied by
1165  /// the computed input independent transform matrix, if any.
1166  ///
1167  /// @return Returns 1 if the matrix was modified, 0 otherwise
1168  virtual int applyInputIndependentTransform(
1169  OP_Context &context, UT_DMatrix4 &mat);
1170 
1171  /// Computes and pre-multiplies an output transform to the given matrix.
1172  /// The output transform is a transform that a parent specifies for its
1173  /// children. This concept exists for completeness (since there is an input
1174  /// transform), but is not widely used.
1175  /// The default implementation does not apply any transform.
1176  ///
1177  /// @param context The cook context, which contains the time.
1178  /// @param mat Input and output parameters, that gets premultipled
1179  /// by an appropriate output transform, if any.
1180  ///
1181  /// @return Returns 1 if the matrix was modified, 0 otherwise
1182  virtual int applyOutputTransform(OP_Context &context, UT_DMatrix4 &mat);
1183 
1184  /// Premuliplies the pre-transform matrix, myPreTransform, to the given
1185  /// matrix. Pre-matrix is a transformation layer between the input and the
1186  /// parameter transforms, and is used to define the origin point (and
1187  /// orientation) at which zero translation and zero rotation would place the
1188  /// object. This allows to have more meaningull parameter values during
1189  /// animation, where rotation of 0 degrees may need to correspond to a
1190  /// slightly bent limb (ie, rotated joint).
1191  ///
1192  /// @param context The cook context, which contains the time.
1193  /// @param mat The input and output parameter, that gets premultipled
1194  /// by a pre-transform matrix.
1195  ///
1196  /// @return Returns 1 if the matrix was modified, 0 otherwise
1197  virtual int applyPreTransform(OP_Context &context, UT_DMatrix4 &mat);
1198 
1199  bool getParentToWorldTransformForInputNoLock(
1200  OBJ_Node *input, OP_Context &context, UT_DMatrix4 &mat, bool applyInputDependentTransform=true);
1201 
1202  // Methods to obtatin and store transformations in a cache. Also
1203  // check if this object is or should be caching xform
1204  const UT_DMatrix4 & getCachedTransform( OP_Context &context,
1206  OBJ_XformCache::OBJ_LookupStatus &status ) const;
1207  void setCachedTransform( OP_Context &context,
1209  const UT_DMatrix4 &xform ) const;
1210  bool isCachingTransforms(int thread) const;
1211 
1212  virtual bool updateParmsFlags() override;
1213 
1214  /// Used to perform proper dependency tracking when cooking the local
1215  /// transform (myXform) from cookMyObj().
1217  {
1218  public:
1219  LocalCookScope(OP_Context &context, OBJ_Node& obj, bool constraint=false);
1220  ~LocalCookScope();
1221  private:
1222  OP_Context& myContext;
1223  OBJ_Node& myObj;
1224  const bool myWasTimeDep;
1225  const bool myWasCooking;
1226  const bool myConstraint;
1227  };
1228  friend class LocalCookScope;
1229  friend class OBJ_NodeParentTransform;
1230 
1231  //
1232  // The cookMe "caches" information - i.e. the world and local xform matrix
1233  virtual OP_ERROR cookMe(OP_Context &context) override;
1234  virtual OP_ERROR bypassMe(OP_Context &context,
1235  int &copied_input) override;
1236  virtual OP_ERROR cookMyObj(OP_Context &context);
1237 
1238  virtual OP_DataType getCookedDataType() const override;
1239  virtual void deleteCookedData() override;
1240  virtual int saveCookedData(const char *, OP_Context &) override;
1241  virtual int saveCookedData(std::ostream &os,
1242  OP_Context &,
1243  int binary = 0) override;
1244 
1245  virtual const char *getFileExtension(int binary) const override;
1246  virtual OP_ERROR saveIntrinsic(std::ostream &os,
1247  const OP_SaveFlags &flags) override;
1248  virtual void saveIntrinsicCommand(std::ostream &os,
1249  const char *name) override;
1250 
1251  virtual bool loadPacket(UT_IStream &is, short class_id, short sig,
1252  const char *path=0) override;
1253  virtual bool loadPacket(UT_IStream &is, const char *token,
1254  const char *path=0) override;
1255 
1256  virtual void saveFlagsForUndo() override;
1257  virtual void getSaveFlagsString(UT_String &cmd,
1258  const char *flags,
1259  bool save_to_hip) const override;
1260  virtual void getPreParmSaveFlagsString( UT_String &cmd ) const override;
1261  virtual void getPostParmSaveFlagsString( UT_String &cmd ) const override;
1262 
1263  // appends the description of the xform to the text. If the xform is not
1264  // an identity the label is printed first and the rst values follow.
1265  // If the xform is identity the text_if_identity is appended instead
1266  // of the whole label and xform printout
1267  void getXformDescription(const UT_DMatrix4 &xform,
1268  const char* label_if_not_identity,
1269  const char* text_if_identity,
1270  const UT_Vector3R pivot,
1271  const UT_Vector3R pivot_rotate,
1272  const UT_XformOrder order,
1273  UT_WorkBuffer &text);
1274 
1275  // types of transormations that we can clean (i.e.,
1276  // transfer from local to pre-transform)
1278  {
1282  OBJ_TRANSFORM_SCALES
1283  };
1284 
1285 
1286  /// Calculates a matrix that needs to be premultiplied with pretransform
1287  /// to transfer the transformation of type 'type' to the pretransform matrix
1288  void getParmTransformTransferMatrix(
1290  OBJ_TransformComponent type,
1291  UT_DMatrix4 &xform );
1292 
1293  // method for propagating the change in capture transform by xform.
1294  // This method is
1295  // overloaded for OBJs that support capture parameters (e.g., OBJ_Bone)
1296  // in order to adjust their global capture position. This is handy
1297  // when editing the caputre pose and when we need to propagate
1298  // a transofrm (e.g., translation) to all the descendents.
1299  virtual void applyToCaptTransformAndDescendents(
1301  const UT_DMatrix4 &xform );
1302 
1303  // method for building a menu containg point groups
1304  virtual void buildPointGroupMenu(
1305  PRM_Name *menu, int size,
1306  const PRM_SpareData *spare, const PRM_Parm *parm);
1307 
1308  // method for building a menu containg primitive groups
1309  virtual void buildPrimitiveGroupMenu(
1310  PRM_Name *menu, int size,
1311  const PRM_SpareData *spare, const PRM_Parm *parm);
1312 
1313 
1314 //_________________________________________________________________________
1315 //
1316 // Convenience Error methods...
1317 //_________________________________________________________________________
1318 //
1319  void addError(int code, const char *msg = 0)
1320  { UTaddError("OBJ", code, msg);}
1321  void addMessage(OBJ_Error code, const char *msg = 0)
1322  { UTaddMessage("OBJ", code, msg);}
1323  void addWarning(OBJ_Error code, const char *msg = 0)
1324  { UTaddWarning("OBJ", code, msg);}
1325  void addFatal(OBJ_Error code, const char *msg = 0)
1326  { UTaddFatal("OBJ", code, msg);}
1327 
1328 public:
1329 
1330  static PRM_SpareData *getMatchSelectButton(int option, int autoscope);
1331 // TODO: We have to make sure that the parent is cooked here!
1332  virtual OBJ_Node *getParentObject();
1334  { return setInput(0, node); }
1335 
1336  OBJ_Node *getInstanceObject(fpreal now) const;
1337  OBJ_Node *getGeometryInstance(fpreal now) const;
1338  OBJ_Node *getParticleObject(fpreal now) const;
1339 
1340  void setLookAtObject(OBJ_Node *node);
1341  void setLookUpObject(OBJ_Node *node);
1342  void setPathObject(OBJ_Node *node);
1343 
1344 protected:
1346  virtual int collectPropertiesFromChannels(
1347  PI_EditScriptedParms &editparms,
1349  const CH_ChannelList &channels);
1350  virtual int collectPropertiesFromParms(
1351  PI_EditScriptedParms &editparms,
1353  PRM_ParmNameMap &nmap);
1354  int collectProperties(PI_EditScriptedParms &editparms,
1356  const CH_ChannelList &channels,
1357  PI_PropertyMap *pmap);
1358  int collectProperties(PI_EditScriptedParms &editparms,
1360  PRM_ParmNameMap &nmap,
1361  PI_PropertyMap *pmap);
1362  void createPropertiesShop();
1363 
1364  // Method to find a SHOP node of a specific type. If the type is
1365  // SHOP_INVALID, any SHOP will be returned. Otherwise, the SHOP at the
1366  // given path must be of the correct type. NULL will be returned if the
1367  // type doesn't match or the path isn't found.
1368 
1369  // Used to get pointer to indirection indices for each object type
1370  virtual int *getIndirect() const = 0;
1371 
1373  int name_idx) const
1374  {
1375  int &parm_idx = getIndirect()[name_idx];
1376  if (parm_idx < 0)
1377  parm_idx = getParmList()->getParmIndex(name);
1378  return parm_idx;
1379  }
1381  int name_idx) const
1382  {
1383  int &parm_idx = getIndirect()[name_idx];
1384  if (parm_idx < 0)
1385  parm_idx = getParmList()->getParmIndex(name);
1386  return parm_idx;
1387  }
1388  PRM_Parm *getCachedParm(const UT_StringRef &name, int name_idx)
1389  {
1390  return getParmList()->getParmPtr(
1391  getCachedParmIndex(name, name_idx));
1392  }
1394  const UT_StringRef &name, int name_idx) const
1395  {
1396  return getParmList()->getParmPtr(
1397  getCachedParmIndex(name, name_idx));
1398  }
1399 
1400  virtual bool getTimeOverride() { return false; }
1401 
1402  // inverseDirty is no more needed because setWorldXform does it automatically.
1403  SYS_DEPRECATED_HDK_REPLACE(16.0, "setWorldXform")
1404  void inverseDirty() { myInverseDirty = true; }
1405 
1407  {
1408  if (myInverseDirty)
1409  {
1410  myInverseDirty = false;
1411  myWorldXform.invert(myIWorldXform);
1412  }
1413  return myIWorldXform;
1414  }
1415 
1416  // Compute the object contraints given a local and a parent transform.
1417  // The contraint network is evaluated and given the parent and local_xforms.
1418  // This updates myXform and myWorldXform.
1419  bool computeConstraints(OP_Context &context);
1420 
1421  // Returns the currently cooked local matrix. Doesn't perform cooking.
1423  { return myXform; }
1424 
1425  // Sets the cooked local matrix during cooking.
1427  { myXform = m; }
1428 
1429  // Returns the currently cooked world matrix. Doesn't perform cooking.
1431  { return myWorldXform; }
1432 
1433  // Sets the cooked world matrix during cooking.
1434  // Also sets the myInverseDirty flag properly.
1436  { myWorldXform = m; myInverseDirty=true; }
1437 
1438 public:
1440  { SET_FLOAT("t", I_T, 0, t, v, add_key) }
1442  { SET_FLOAT("t", I_T, 1, t, v, add_key) }
1444  { SET_FLOAT("t", I_T, 2, t, v, add_key) }
1446  { SET_FLOAT("r", I_R, 0, t, v, add_key) }
1448  { SET_FLOAT("r", I_R, 1, t, v, add_key) }
1450  { SET_FLOAT("r", I_R, 2, t, v, add_key) }
1452  { SET_FLOAT("s", I_S, 0, t, v, add_key) }
1454  { SET_FLOAT("s", I_S, 1, t, v, add_key) }
1456  { SET_FLOAT("s", I_S, 2, t, v, add_key) }
1458  { SET_FLOAT("p", I_P, 0, t, v, add_key) }
1460  { SET_FLOAT("p", I_P, 1, t, v, add_key) }
1462  { SET_FLOAT("p", I_P, 2, t, v, add_key) }
1465  { SET_FLOAT("pr", I_PIVOTR, 0, t, v, add_key) }
1468  { SET_FLOAT("pr", I_PIVOTR, 1, t, v, add_key) }
1471  { SET_FLOAT("pr", I_PIVOTR, 2, t, v, add_key) }
1474  { SET_FLOAT("scale", I_SCALE, 0, t, v, add_key) }
1475 
1476  void setTRANSORDER(int v) { SET_INT("xOrd", I_XORDER, 0, 0, v) }
1477  void setROTORDER(int v) { SET_INT("rOrd", I_RORDER, 0, 0, v) }
1478  void setKEEPPOS(int v) { SET_INT("keeppos", I_KEEPPOS, 0, 0, v) }
1479  void setCHILDCOMP(int v) { SET_INT("childcomp", I_CHILDCOMP, 0, 0, v) }
1480 
1481  int KEEPPOS(fpreal t) const { INT_OBJ_PARM("keeppos", I_KEEPPOS, 0, t) }
1482  int TRS(fpreal t) const { INT_OBJ_PARM("xOrd", I_XORDER, 0, t); }
1483  int XYZ(fpreal t) const { INT_OBJ_PARM("rOrd", I_RORDER, 0, t); }
1484  int CHILDCOMP(fpreal t) const { INT_OBJ_PARM("childcomp", I_CHILDCOMP, 0, t) }
1485 
1486  void T(fpreal *v, fpreal t) { FLOAT_OBJ_PARMS("t", I_T, v, t) }
1487  void R(fpreal *v, fpreal t) { FLOAT_OBJ_PARMS("r", I_R, v, t) }
1488  void S(fpreal *v, fpreal t) { FLOAT_OBJ_PARMS("s", I_S, v, t) }
1489  void P(fpreal *v, fpreal t) { FLOAT_OBJ_PARMS("p", I_P, v, t) }
1491  { FLOAT_OBJ_PARMS("pr", I_PIVOTR, v, t) }
1492 
1494 
1495  void LOOKUP(UT_String &str, fpreal t)
1496  { STR_OBJ_PARM ("lookup", I_LOOKUP, 0, t) }
1497  // types of allowed path parameterization
1498  // NB: these correspond to the menu entries in thePathParmTypes[]
1500  {
1501  OBJ_PATHPARM_UNIFORM = 0,
1502  OBJ_PATHPARM_ARCLEN
1503  };
1504 
1506  int PATHPARMTYPE(fpreal t) { INT_OBJ_PARM("uparmtype", I_PATHUPARMTYPE,0,t) }
1507  int PATHORIENT(fpreal t) { INT_OBJ_PARM("pathorient", I_PATHORIENT, 0, t) }
1510  { FLOAT_OBJ_PARMS("up", I_PATHUP, v, t) }
1512 
1513  int PICKING() {INT_OBJ_PARM("picking", I_PICKING, 0, 0) }
1515  {STR_OBJ_PARM("pickscript", I_PICKSCRIPT, 0, t)}
1516  int CACHING() {INT_OBJ_PARM("caching", I_CACHING, 0, 0) }
1517 
1518  // This parameter is only important in specific classes, so is not
1519  // defined here at the base level.
1520  virtual int VPORT_SHADEOPEN() { return 0; }
1521  virtual int VPORT_DISPLAYASSUBDIV() { return 0; }
1522 
1523  fpreal SHADERATE(fpreal t, fpreal defval=1);
1524  int PHANTOM(fpreal t, int default_value);
1525  int MATTE(fpreal t, int default_value);
1526  int RAYBOUNCE(fpreal t, int default_value);
1527  int TRANSMITBOUNCE(fpreal t, int default_value);
1528  fpreal RAYCLIP(fpreal t, fpreal def=0.001);
1529  fpreal DISPBOUND(fpreal t, fpreal def=0);
1530  fpreal SHADOWRATE(fpreal t, fpreal def=1);
1531  fpreal REFLRATE(fpreal t, fpreal def=1);
1532  fpreal LOD(fpreal t, fpreal def=1);
1533  void PREINCLUDE(UT_String &str, fpreal t);
1534  void POSTINCLUDE(UT_String &str, fpreal t);
1537 
1538 
1540  { return evalInt("use_dcolor", &getIndirect()[I_USE_DCOLOR],
1541  0, 0); }
1545 
1547  {
1548  UT_Color col(UT_RGB);
1549  fpreal32 c[3];
1550  evalFloats("dcolor", &getIndirect()[I_DCOLOR], c, t);
1551  col.setRGB(c[0], c[1], c[2]);
1552  return col;
1553  }
1554 
1556  { SET_FLOAT("dcolor", I_DCOLOR, 0, t, r, PRM_AK_MARK_PENDING) }
1558  { SET_FLOAT("dcolor", I_DCOLOR, 1, t, g, PRM_AK_MARK_PENDING) }
1560  { SET_FLOAT("dcolor", I_DCOLOR, 2, t, b, PRM_AK_MARK_PENDING) }
1561 
1562  int DISPLAY(fpreal t) const;
1563 
1564  int parmIndexDISPLAY() const
1565  { return getCachedParmIndex("display", I_DISPLAY); }
1566 
1567  // Determine whether the geometry is really displayed. If the display
1568  // channel is turned off, then we use the display flag. Use this as opposed
1569  // to isDisplayDisabled() unless you do *not* want to check this object's
1570  // display flag. A network can be specified to ignore the display state
1571  // of any parents starting with that network.
1572  bool getObjectDisplay(fpreal t, const OP_Network *n=0) const
1573  {
1574  return getDisplay() && !isDisplayDisabled(t, n);
1575  }
1576  GEO_ViewportLOD getObjectDisplayStyle(fpreal t,
1577  const OP_Network *net = NULL,
1578  bool ignore_display=false) const;
1579  bool isDisplayTimeDependent() const;
1580 
1581  // Determine whether the geometry is disabled for display. If the display
1582  // channel is turned off, then we use the display flag. A network can be
1583  // specified to ignore the display state of any parents starting with that
1584  // network.
1585  int isDisplayDisabled(fpreal t,
1586  const OP_Network *net = 0) const;
1587 
1588  // setVisible() differs from setDisplay() in that it will try to set the
1589  // display flag on parent subnets and change visible object parameters as
1590  // necessary.
1591  virtual bool setVisible(int onoff) override;
1592  virtual bool getVisible() const override;
1593 
1594  virtual void evaluateBatchParms(PRM_BatchList &list,
1595  fpreal now) override;
1596 
1597  // These parameters are cached
1598 
1599  int TDISPLAY() const;
1600  int parmIndexTDISPLAY() const
1601  {
1602  return getCachedParmIndex("tdisplay", I_TDISPLAY);
1603  }
1604 
1606  {
1607  return getCachedParmIndex("constraints_on", I_CONSTRAINTS_ON);
1608  }
1609 
1611  {
1612  return getCachedParmIndex("constraints_path", I_CONSTRAINTS);
1613  }
1614 
1615  int INSTANCE(UT_String &str, fpreal now) const;
1616  int POINTINSTANCE(fpreal now) const;
1617  int PARTICLE(UT_String &s, fpreal t) const;
1618  bool PTMOTIONBLUR(UT_String &str, fpreal now) const;
1619 
1620  int LOOKAT(UT_String &str, fpreal t) const
1621  {
1622  STR_OBJ_PARM ("lookatpath", I_LOOKAT, 0, t)
1623  return str.isstring();
1624  }
1625 
1626  int LOOKUPOBJ(UT_String &str, fpreal t) const
1627  {
1628  STR_OBJ_PARM ("lookupobjpath", I_LOOKUPOBJ, 0, t)
1629  return str.isstring();
1630  }
1631 
1632  int PATHSOP(UT_String &str, fpreal t) const
1633  {
1634  STR_OBJ_PARM ("pathobjpath", I_PATHOBJ, 0, t)
1635  return str.isstring();
1636  }
1637 
1638  // This is used by the viewer to determine whether or not to cook (and show)
1639  // particle guide geometry at the object level.
1641  { return getDefaultedIProperty("vport_promote_popguides", t,1); }
1642 
1643  // This is used by DM_VPortAgent3D to determine what order to
1644  // draw objects in. It itself will set it depending on user defined
1645  // order, so it really is a temporary one-per-object flag.
1646  int getDisplayOrder() const
1647  {
1648  return myDisplayOrder;
1649  }
1651  {
1652  myDisplayOrder = order;
1653  }
1654 
1655  // This is used by OBJ_SubNet. This is called on all child objects
1656  // when the Visible Children parameter changes.
1658  { myDisplayDisabledBySubnetNeedsUpdate = 1; }
1659 
1660  void addTransformParmInterests( OP_Node *interested );
1661 
1662  int getDefaultedIProperty(const char *name, fpreal now, int def) const
1663  {
1664  int val;
1665  if (evalParameterOrProperty(name, 0, now, val))
1666  return val;
1667  return def;
1668  }
1669  fpreal getDefaultedFProperty(const char *name, fpreal now, fpreal def) const
1670  {
1671  fpreal val;
1672  if (evalParameterOrProperty(name, 0, now, val))
1673  return val;
1674  return def;
1675  }
1676  const char *getDefaultedSProperty(const char *name, fpreal now,
1677  UT_String &result, const char *def) const
1678  {
1679  if (!evalParameterOrProperty(name, 0, now, result))
1680  result = def;
1681  return result;
1682  }
1683  const char *getDefaultedRawSProperty(const char *name, fpreal now,
1684  UT_String &result, const char *def) const
1685  {
1686  if (!evalParameterOrPropertyRaw(name, 0, now, result))
1687  result = def;
1688  return result;
1689  }
1690 
1691  virtual int64 getMemoryUsage(bool inclusive) const override;
1692 
1693  OP_Node *getEvaluatedConstraints();
1694 
1695  // Evaluate the constraint path parameter and strip the optional channel name.
1696  OP_Node *parseConstraintPath( UT_String &path, UT_String &channel, int add_dep );
1697  OP_Node *parseConstraintPath( UT_String &path, UT_String &channel, int add_dep, bool &got_by_flag );
1698 
1699  const UT_Color &DCOLORREF(fpreal t, int &use_color)
1700  {
1701  use_color = USE_DCOLOR();
1702  if( use_color )
1703  {
1704  myWireColor.setType(UT_RGB);
1705 
1706  char *p = (char*)(void*)&myWireColor;
1707  p += sizeof(UT_ColorType);
1708 
1709  fpreal32* c = (fpreal32*)p;
1710  evalFloats("dcolor", &getIndirect()[I_DCOLOR], c, t);
1711  }
1712 
1713  return myWireColor;
1714  }
1715 
1716  virtual void onCreated(void) override;
1717 
1718 protected:
1719  virtual void checkTimeDependencies(int do_parms=1,
1720  int do_inputs=1,
1721  int do_extras=1) override;
1722 private: // methods
1723  friend class OBJ_UndoPreTransform;
1724 
1725  void evalBLUR(UT_String &result, fpreal now);
1726  void checkKeepPosWhenParenting( OBJ_Node *parent_obj );
1727 
1728  const PRM_Parm * findTransformProperty(
1729  fpreal t, const UT_StringRef &name) const;
1730  PRM_Parm * findTransformProperty(
1731  fpreal t, const UT_StringRef &name);
1732 
1733  template <typename OBJ_NODE, typename VISITOR>
1734  static void visitTransformParms(
1735  OBJ_NODE *node,
1736  fpreal t,
1737  bool exclude_uniform_scale,
1738  VISITOR& visitor);
1739 
1740  bool hasTransformParmChannels(
1741  fpreal t,
1742  bool exclude_uniform_scale) const;
1743 
1744  int evalToggleInt(char *togglename, int toggleindirect,
1745  char *parm, int parmindirect,
1746  fpreal t, int def = 0);
1747  fpreal evalToggleFloat(char *togglename, int toggleindirect,
1748  char *parm, int parmindirect,
1749  fpreal t, fpreal defval = 1);
1750  int evalToggleParm(const char *togglename,
1751  const char *token, fpreal now,
1752  int value);
1753  fpreal evalToggleParm(const char *togglename,
1754  const char *token, fpreal now,
1755  fpreal value);
1756 
1757  void computeSubnetParentTransform(
1759  const UT_ValArray<OBJ_Node *> &parentstack,
1760  UT_DMatrix4 &world_xform);
1761 
1762  void addTransformDependencies( OBJ_Node *subnet );
1763 
1764  void propagateKeepPosWhenMoving();
1765 
1766  void dirtyPreTransform();
1767  void updatePreTransformParms( bool from, bool undo=true);
1768  void updatePreTransformParms( bool from, bool undo, fpreal now, int thread);
1769  void getPreTransformParms( OP_Context &ctx, UT_Matrix4D &mat );
1770 
1771  void applyBackwardsRiTransmitCompatibility(
1772  PRM_ParmList *obsolete_parms);
1773 
1774  virtual const char *inputLabel(unsigned) const override;
1775 
1776  void applyLimits( OP_Context &context, fpreal *t, fpreal *r, fpreal *s );
1777  template<int OFFSET>
1778  void applyLimit( OP_Context &context, fpreal *t );
1779 
1780  void onChangeSpareParms();
1781  void cookLocalXform(OP_Context &context, const UT_DMatrix4 &pmat);
1782 
1783  /// Declares that this node's data depends on the @c op for the given
1784  /// reason (OP_INTEREST_DATA, OP_INTEREST_FLAG).
1785  /// This OBJ override also supports OP_INTEREST_INPUT and redirects it to a call to addOpReference()
1786  /// @note There are no other acceptable values for type.
1787  void addExtraObjInput(OP_Node *op, OP_InterestType type);
1788 
1789  /// All OBJ nodes can be a selection owner.
1790  /// This replaces the previous inheritance from SOP_SelectionOwner.
1791  virtual bool isSelectionOwnerType() const final
1792  { return true; }
1793 
1794  template<int HAS_DEP>
1795  bool internalGetRawParmTransform(OP_Context &context, UT_DMatrix4 &xform, OBJ_AutoTransformDependencies *in_dep );
1796 
1797 private: // data
1798 
1799 
1800  // Pre H16, myWorldXform and myXform used to be protected.
1801  // When cooking a derived OBJ_Node, use setWorldXform and setLocalXform instead.
1802  UT_DMatrix4 myXform; // Transform in parent's space
1803  UT_DMatrix4 myWorldXform; // Transform in world space
1804  UT_DMatrix4 myIWorldXform; // Inverse Xform in world space
1805 
1806  // myPreTransform is right multiplied into the actual parms version of
1807  // the local object transform when we cook.
1808  // ie. myXform includes myPreTransform after being cooked
1809  UT_DMatrix4 myPreTransform;
1810 
1811  OP_Node *myEvaluatedConstraints;
1812 
1813  // Micro-node for determining when myXform is dirty
1814  class obj_XformMicroNode : public OP_DataMicroNode
1815  {
1816  public:
1817  obj_XformMicroNode(OP_Node &node)
1818  : OP_DataMicroNode(node)
1819  {
1820  }
1821  virtual const char *className() const
1822  {
1823  return "obj_XformMicroNode";
1824  }
1825  };
1826  obj_XformMicroNode myXformMicroNode;
1827  int myXformCookLevel;
1828 
1829  DEP_MicroNode myModeMicroNode;
1830 
1831  int myShopMaterialIndex; // Cache of parm index
1832  uint myShopMaterialIndexLastCheck; // Add/remove count
1833 
1834  unsigned myPreTransformIsIdentity:1,
1835  myTraversingForBlur:1,
1836  mySubnetParentTimeDep:1,
1837  myShowingPreTransform:1,
1838  myUpdatingPreTransform:1,
1839  myInverseDirty:1,
1840  myUseFullTransformModel:1,
1841  myCookingRender:1,
1842  myLimitsFlags:18,
1843  myHasLookAt:1,
1844  myHasPath:1,
1845  myHasConstraints:1,
1846  myGotConstraintsByFlag:1;
1847 
1848  mutable unsigned myDisplayDisabledBySubnetNeedsUpdate:1,
1849  myDisplayDisabledBySubnet:1,
1850  myInstanceRecursion:1;
1851 
1852  OBJ_NodeFlags myObjFlags;
1853 
1854  // This gets this nodes precedence in display order.
1855  int myDisplayOrder;
1856 
1857  // These variables are for computing the parent xform
1858  UT_ValArray<OP_VERSION> mySubnetParentVersion;
1859  UT_DMatrix4 mySubnetParentTransform;
1860 
1861  enum objLimits
1862  {
1863  MIN_TX = 1<<0,
1864  MIN_TY = 1<<1,
1865  MIN_TZ = 1<<2,
1866  MIN_RX = 1<<3,
1867  MIN_RY = 1<<4,
1868  MIN_RZ = 1<<5,
1869  MIN_SX = 1<<6,
1870  MIN_SY = 1<<7,
1871  MIN_SZ = 1<<8,
1872 
1873  MAX_TX = 1<<9,
1874  MAX_TY = 1<<10,
1875  MAX_TZ = 1<<11,
1876  MAX_RX = 1<<12,
1877  MAX_RY = 1<<13,
1878  MAX_RZ = 1<<14,
1879  MAX_SX = 1<<15,
1880  MAX_SY = 1<<16,
1881  MAX_SZ = 1<<17,
1882  };
1883 
1884  // Pair of Parm* and Long
1885  struct objSpareParam
1886  {
1887  objSpareParam();
1888  objSpareParam( OBJ_Node *obj, const char* name);
1889 
1890  void reset()
1891  {
1892  parm = NULL;
1893  id = -1;
1894  }
1895 
1896  PRM_Parm *parm;
1897  int id;
1898  };
1899  // Struct holding the object spare properties pointers
1900  // for faster access and to only add a pointer to OBJ_Node class.
1901  struct objSpareProperties
1902  {
1903  // returns true if all the Parm pointers are NULL.
1904  // this should be called before disposing of myProperties.
1905  // PLEASE UPDATE when adding new data members
1906  bool isEmpty() const;
1907  void reset();
1908 
1909  // Pre-Transform Category
1910  objSpareParam myPreXOrd;
1911  objSpareParam myPreROrd;
1912  objSpareParam myPreTranslate;
1913  objSpareParam myPreRotate;
1914  objSpareParam myPreScale;
1915 
1916  // Limits Category
1917  objSpareParam myLimitsOn[18];
1918  objSpareParam myLimits[18];
1919 
1920  objSpareParam myParentToBoneTip;
1921  };
1922  objSpareProperties *myProperties;
1923 
1924  UT_Color myWireColor;
1925  UT_String myConstraintsChannel;
1926  int myConstraintsChannelIndex;
1927 
1928  DEP_MicroNode myRawParmTransformMicroNode;
1929 
1930  mutable DEP_TimedMicroNode myDisplayMicroNode;
1931  mutable int myCachedDisplay;
1932  mutable DEP_MicroNode myTDisplayMicroNode;
1933  mutable int myCachedTDisplay;
1934 
1935 private: // static data
1936 
1937  static OBJ_KeepPosType ourKeepPosWhenParenting;
1938  static OBJ_KeepPosType ourKeepPosWhenMoving;
1939  static bool ourAllowKeepPos;
1940  static bool ourIgnorePretransformValue;
1941  static bool ourAllowIgnorePretransform;
1942 };
1943 
1944 inline int
1946 {
1947  return evalIntT("caching", &getIndirect()[I_CACHING], 0, 0, thread);
1948 }
1949 
1950 inline bool
1952 {
1954 
1955  // the intercept mode is used by some CHOPs to map the current time
1956  // beyond the frame limits. In this case we cannot guarantee that
1957  // caching a matrix at frame, say, 2 and then after one play cycle
1958  // again at frame 2 (which is sort of frame 302) is refering to the
1959  // same xform (assuming 1..300 range). In these situatin we turn off
1960  // caching.
1961  // NB: the intercept mode is entered via SCROLL LOCK key
1962 
1963  return (mode != 1) && getCachable(thread);
1964 }
1965 
1966 #undef FLOAT_OBJ_PARM
1967 #undef FLOAT_OBJ_PARMS
1968 #undef INT_OBJ_PARM
1969 #undef STR_OBJ_PARM
1970 
1971 #undef SET_FLOAT
1972 #undef SET_INT
1973 #undef SET_STRING
1974 
1975 extern "C" {
1977 };
1978 
1980 {
1981 public:
1983  : myContext(ctx)
1984  , myAddTimeDep(true)
1985  , myCaller(nullptr)
1986  , myCallerUserData(nullptr)
1987  , myCallerTransformUserData(nullptr)
1988  {
1989  OP_ContextData *ctx_data = ctx.getData();
1990  if( ctx_data )
1991  {
1992  OP_TransformContextData *tud = dynamic_cast<OP_TransformContextData*>( ctx_data );
1993  if( tud != nullptr )
1994  {
1995  myCallerUserData = ctx_data;
1996  myCallerTransformUserData = tud;
1997  myCaller = tud->getCallerNode();
1998  UT_ASSERT(myCaller);
1999  myContext.setData(nullptr);
2000 
2001  CHOP_Node *chop = myCaller->castToCHOPNode();
2002  if( chop )
2003  {
2004  myAddTimeDep = chop->isUsingCurrentFrameForVexTransformContext();
2005  }
2006  }
2007  }
2008  }
2009 
2011  {
2012  resetUserData();
2013  }
2014 
2016  {
2017  if( myCallerUserData )
2018  {
2019  if( myExtraInputs.size() )
2020  myCaller->addExtraInputs( myExtraInputs );
2021 
2022  if( myExtraMicroNodes.size() )
2023  myCaller->addExtraInputs( myExtraMicroNodes );
2024 
2025 
2026  myContext.setData(myCallerUserData);
2027 
2028  myCaller = nullptr;
2029  myCallerUserData = nullptr;
2030  myCallerTransformUserData = nullptr;
2031  }
2032  }
2033 
2035  {
2036  if( !myCaller || !dep )
2037  return;
2038 
2039  myExtraMicroNodes.append( dep );
2040 
2041  // Force time dependency from time dependent parameters
2042  if( myAddTimeDep )
2043  {
2044  if( !myCaller->flags().getTimeDep() && dep->inheritTimeDependentFromExplicitInputs() )
2045  {
2046  myCaller->flags().setTimeDep(true);
2047  }
2048  }
2049  }
2050 
2052  {
2053  if( !myCaller || !src )
2054  return;
2055 
2056  // If the node is being deleted, then don't add it to our extra inputs, or
2057  // else we will get end up getting a dangling reference.
2058  if (src->isBeingDeleted())
2059  {
2060  // The UT_ASSERT() here makes it easier to be aware of these situations
2061  // but in general, the user can produce these situations easily because
2062  // channel references can be evaluated right away which then cause them
2063  // to attempt to add an extra input on the node being deleted.
2064  UT_ASSERT(!"Adding an extra input onto a deleted node");
2065  return;
2066  }
2067 
2068  ((OBJ_Node*)myCaller)->addExtraObjInput(src, type);
2069  }
2070 
2071  void addExtraInput( OP_Node *src, int pi, int vi=0 )
2072  {
2073  addExtraInput( src, pi, vi, vi);
2074  }
2075 
2076  void addExtraInput( OP_Node *src, int pi, int vi_start, int vi_end )
2077  {
2078  if( !myCaller || !src )
2079  return;
2080 
2081  // If the node is being deleted, then don't add it to our extra inputs, or
2082  // else we will get end up getting a dangling reference.
2083  if (src->isBeingDeleted())
2084  {
2085  // The UT_ASSERT() here makes it easier to be aware of these situations
2086  // but in general, the user can produce these situations easily because
2087  // channel references can be evaluated right away which then cause them
2088  // to attempt to add an extra input on the node being deleted.
2089  UT_ASSERT(!"Adding an extra input onto a deleted node");
2090  return;
2091  }
2092 
2093  for( int vi=vi_start; vi<=vi_end; ++vi )
2094  {
2095  myExtraInputs.append( OP_InterestRef(*src,pi,vi) );
2096  }
2097 
2098  // Force time dependency from time dependent parameters
2099  if( myAddTimeDep )
2100  {
2101  if( !myCaller->flags().getTimeDep() &&src->getParmList()->getTimeDependent() )
2102  {
2103  PRM_Parm *p = src->getParmList()->getParmPtr(pi);
2104  if( p )
2105  {
2106  for( int vi=vi_start; vi<=vi_end; ++vi )
2107  {
2108  if( p->isTimeDependent(vi) )
2109  {
2110  myCaller->flags().setTimeDep(true);
2111  break;
2112  }
2113  }
2114  }
2115  }
2116  }
2117  }
2118 
2119  bool hasCaller() const { return myCaller;}
2120  bool getExtraArgs( int &xord, int &rord, int &mask)
2121  {
2122  if( myCallerTransformUserData )
2123  return myCallerTransformUserData->getExtraArgs(xord,rord,mask);
2124  return false;
2125  }
2126 
2127 
2128 private:
2129  OP_Context &myContext;
2130  OP_ContextData *myCallerUserData;
2131  OP_TransformContextData *myCallerTransformUserData;
2132  OP_Node *myCaller;
2133  bool myAddTimeDep;
2136 };
2137 #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:1323
UT_DMatrix4 & getPreTransform()
Definition: OBJ_Node.h:683
virtual bool getTimeOverride()
Definition: OBJ_Node.h:1400
void setTX(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1439
virtual OBJ_Bone * castToOBJBone()
Definition: OBJ_Node.h:988
vint4 max(const vint4 &a, const vint4 &b)
Definition: simd.h:4703
const UT_Matrix4D & getLocalXform() const
Definition: OBJ_Node.h:1422
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:57
GLenum GLenum GLenum input
Definition: glew.h:13879
int PATHPARMTYPE(fpreal t)
Definition: OBJ_Node.h:1506
OBJ_ParmsStyle
Definition: OBJ_Node.h:208
virtual const OP_DataMicroNode & dataMicroNodeConst() const override
Definition: OBJ_Node.h:1074
DOP_Node * getDisplayDopPtr()
Definition: OBJ_Node.h:703
void R(fpreal *v, fpreal t)
Definition: OBJ_Node.h:1487
GLuint id
Definition: glew.h:1679
virtual OBJ_Sticky * castToOBJSticky()
Definition: OBJ_Node.h:998
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:990
void T(fpreal *v, fpreal t)
Definition: OBJ_Node.h:1486
#define SYS_DEPRECATED(__V__)
GLuint const GLchar * name
Definition: glew.h:1814
virtual int VPORT_SHADEOPEN()
Definition: OBJ_Node.h:1520
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:1277
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:1469
void setSCALE(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1472
virtual fpreal getH() const
Node position/scale is used by the UI.
void addFatal(OBJ_Error code, const char *msg=0)
Definition: OBJ_Node.h:1325
Definition: OBJ_Node.h:156
void setDCOLORB(fpreal t, fpreal b)
Definition: OBJ_Node.h:1559
const char * getDefaultedSProperty(const char *name, fpreal now, UT_String &result, const char *def) const
Definition: OBJ_Node.h:1676
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:2051
GLuint index
Definition: glew.h:1814
fpreal PATHBANK(fpreal t)
Definition: OBJ_Node.h:1511
int parmIndexCONSTRAINTSPATH() const
Definition: OBJ_Node.h:1610
bool getExtraArgs(int &xord, int &rord, int &mask)
Definition: OBJ_Node.h:2120
void setSZ(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1455
void setDisplayOrder(int order)
Definition: OBJ_Node.h:1650
GLuint const GLfloat * val
Definition: glew.h:2794
int getParentingErrorFlag() const
Definition: OBJ_Node.h:809
static const char * input2ObjectToken
Definition: OBJ_Node.h:969
void P(fpreal *v, fpreal t)
Definition: OBJ_Node.h:1489
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:1620
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:1000
#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:2071
bool isCachingTransforms(int thread) const
Definition: OBJ_Node.h:1951
int PICKING()
Definition: OBJ_Node.h:1513
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:987
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
void setParentingErrorFlag(int o)
Definition: OBJ_Node.h:811
UT_ErrorSeverity
Definition: UT_Error.h:25
Parameters for OP_Node::getInfoText()/OP_Node::getNodeSpecificInfoText()
virtual const char * getSetScaleParmName() const
Definition: OBJ_Node.h:934
Definition: OBJ_Node.h:157
int USE_DCOLOR()
Definition: OBJ_Node.h:1539
int PATHSOP(UT_String &str, fpreal t) const
Definition: OBJ_Node.h:1632
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:1626
GLhandleARB obj
Definition: glew.h:6236
virtual void getParallelInputs(OP_Context &context, OP_NodeList &nodes) const
virtual int isCookingRender() const override
Definition: OBJ_Node.h:814
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:992
GLboolean reset
Definition: glew.h:4959
virtual void getNodeSpecificInfoText(OP_Context &context, OP_NodeInfoParms &parms)
CHOP_Node * castToCHOPNode() const
Definition: OP_Node.h:580
UT_API UT_ErrorSeverity UTaddMessage(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
void PICKSCRIPT(UT_String &str, fpreal t)
Definition: OBJ_Node.h:1514
UT_Color DCOLOR(fpreal t)
Definition: OBJ_Node.h:1546
int XYZ(fpreal t) const
Definition: OBJ_Node.h:1483
virtual int VPORT_DISPLAYASSUBDIV()
Definition: OBJ_Node.h:1521
void setSX(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1451
fpreal getDefaultedFProperty(const char *name, fpreal now, fpreal def) const
Definition: OBJ_Node.h:1669
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:1488
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:1699
const char * getDefaultedRawSProperty(const char *name, fpreal now, UT_String &result, const char *def) const
Definition: OBJ_Node.h:1683
virtual void opChanged(OP_EventType reason, void *data=0)
long long int64
Definition: SYS_Types.h:111
#define FLOAT_OBJ_PARMS(name, idx, v, t)
Definition: OBJ_Node.h:219
obj_PathParmType
Definition: OBJ_Node.h:1499
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:1566
OP_InterestType
Definition: OP_DataTypes.h:45
obj_OnionSkin
Definition: OBJ_Node.h:717
void addExtraInput(OP_Node *src, int pi, int vi_start, int vi_end)
Definition: OBJ_Node.h:2076
int KEEPPOS(fpreal t) const
Definition: OBJ_Node.h:1481
virtual int * getIndirect() const =0
fpreal DCOLORR(fpreal t)
Definition: OBJ_Node.h:1542
void PIVOTR(fpreal *v, fpreal t)
Definition: OBJ_Node.h:1490
Definition: OBJ_Node.h:155
int TRS(fpreal t) const
Definition: OBJ_Node.h:1482
GLuint in
Definition: glew.h:11510
GA_API const UT_StringHolder trans
virtual int getPickable()
Definition: OP_Node.h:1316
void setDCOLORR(fpreal t, fpreal r)
Definition: OBJ_Node.h:1555
virtual int setPickable(int on_off)
Definition: OP_Node.h:1273
void LOOKUP(UT_String &str, fpreal t)
Definition: OBJ_Node.h:1495
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
virtual bool evalVariableValue(UT_String &val, int index, int thread) override
Definition: OBJ_Node.h:251
#define SET_INT(name, parm_index, vector_index, t, val)
Definition: OBJ_Node.h:228
int getInterceptMode() const
Definition: UT_Playback.h:84
int getCachedParmIndex(const UT_StringRef &name, int name_idx) const
Definition: OBJ_Node.h:1372
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.
static OBJ_KeepPosType getGlobalKeepPosWhenMoving()
Definition: OBJ_Node.h:863
int getCachedParmIndex(const PRM_Name &name, int name_idx) const
Definition: OBJ_Node.h:1380
virtual bool getHideDefaultParms() const
Definition: OBJ_Node.h:1061
void addError(int code, const char *msg=0)
Definition: OBJ_Node.h:1319
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:1441
GLsizei n
Definition: glew.h:4040
int PATHORIENT(fpreal t)
Definition: OBJ_Node.h:1507
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:1453
OBJ_KeepPosType
Definition: OBJ_Node.h:199
int parmIndexDISPLAY() const
Definition: OBJ_Node.h:1564
virtual const char * getSetTranslateParmName() const
Definition: OBJ_Node.h:936
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:1508
virtual OBJ_Ambient * castToOBJAmbient()
Definition: OBJ_Node.h:986
int parmIndexTDISPLAY() const
Definition: OBJ_Node.h:1600
void addMessage(OBJ_Error code, const char *msg=0)
Definition: OBJ_Node.h:1321
#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:1640
void addExtraInput(DEP_MicroNode *dep)
Definition: OBJ_Node.h:2034
virtual fpreal getW() const
Node position/scale is used by the UI.
OP_OpTypeId
Definition: OP_OpTypeId.h:18
void setLocalXform(const UT_Matrix4D &m)
Definition: OBJ_Node.h:1426
virtual OBJ_Camera * castToOBJCamera()
Definition: OBJ_Node.h:989
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:1099
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:999
void setCHILDCOMP(int v)
Definition: OBJ_Node.h:1479
void setTZ(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1443
OBJ_AutoTransformDependencies(OP_Context &ctx)
Definition: OBJ_Node.h:1982
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:1555
virtual bool getBoundingBox(UT_BoundingBox &box, OP_Context &)
void setROTORDER(int v)
Definition: OBJ_Node.h:1477
int CHILDCOMP(fpreal t) const
Definition: OBJ_Node.h:1484
fpreal DCOLORB(fpreal t)
Definition: OBJ_Node.h:1544
unsigned int uint
Definition: SYS_Types.h:44
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:1430
int getCachable(int thread) const
Definition: OBJ_Node.h:1945
GLuint GLsizei GLsizei GLchar * label
Definition: glew.h:8986
virtual int getDisplayOrigin() const
Definition: OP_Node.h:1324
bool getObjectDisplay(fpreal t, const OP_Network *n=0) const
Definition: OBJ_Node.h:1572
virtual const OP_DataMicroNode & parmListMicroNodeConst() const override
Definition: OBJ_Node.h:1067
virtual OP_ERROR setNamedIndirectInput(const OP_ConnectorId &input_name, OP_IndirectInput *input)
virtual bool createSpareParametersFromChannels(UT_BitArray &selection, const CH_ChannelList &channels)
int CACHING()
Definition: OBJ_Node.h:1516
GLsizei const GLchar *const * path
Definition: glew.h:6461
virtual OBJ_Light * castToOBJLight()
Definition: OBJ_Node.h:995
fpreal PATHPOS(fpreal t)
Definition: OBJ_Node.h:1505
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)
double fpreal
Definition: SYS_Types.h:276
A map of string to various well defined value types.
Definition: UT_Options.h:42
void setWorldXform(const UT_Matrix4D &m)
Definition: OBJ_Node.h:1435
void setRY(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1447
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:1509
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:1388
static OBJ_KeepPosType getGlobalKeepPosWhenParenting()
Definition: OBJ_Node.h:858
int getDisplayOrder() const
Definition: OBJ_Node.h:1646
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
virtual bool isUsingCurrentFrameForVexTransformContext() const
Definition: OP_Node.h:3752
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:997
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:1466
virtual int setFlag(char tag, int on_off)
virtual int setDisplayOrigin(int on_off_unchanged)
Definition: OP_Node.h:1281
int getDefaultedIProperty(const char *name, fpreal now, int def) const
Definition: OBJ_Node.h:1662
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
Definition: glew.h:12681
virtual void referencedParmChanged(int pi)
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:1605
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:1449
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:994
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:1476
virtual bool evalVariableValue(UT_String &val, int index, int thread)
GLuint64EXT * result
Definition: glew.h:14007
bool isstring() const
Definition: UT_String.h:705
bool inheritTimeDependentFromExplicitInputs()
OBJ_MOTIONBLUR_TYPE
Definition: OBJ_Node.h:116
virtual OBJ_Fetch * castToOBJFetch()
Definition: OBJ_Node.h:991
int isBeingDeleted() const
Definition: OP_Node.h:1378
const UT_DMatrix4 & getInverseXform()
Definition: OBJ_Node.h:1406
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:1457
void setPZ(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1461
#define const
Definition: zconf.h:214
virtual void propagateEndBlockModify()
void setRX(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1445
#define OBJ_API
Definition: OBJ_API.h:10
fpreal SCALE(fpreal t)
Definition: OBJ_Node.h:1493
SYS_FORCE_INLINE PRM_ParmList * getParmList()
Definition: PRM_ParmOwner.h:67
OP_VERSION parmListModVersion() const
Definition: OBJ_Node.h:1069
void setPY(fpreal t, fpreal v, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
Definition: OBJ_Node.h:1459
virtual OBJ_Null * castToOBJNull()
Definition: OBJ_Node.h:996
OBJ_NodeFlags & objflags()
Definition: OBJ_Node.h:820
GLsizei const GLfloat * value
Definition: glew.h:1849
float fpreal32
Definition: SYS_Types.h:195
void setDCOLORG(fpreal t, fpreal g)
Definition: OBJ_Node.h:1557
virtual void setCookingRender(int val) override
Definition: OBJ_Node.h:817
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:1463
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:993
static const char * input1ObjectToken
Definition: OBJ_Node.h:968
virtual OP_Node * getDisplayNodePtr()
fpreal DCOLORG(fpreal t)
Definition: OBJ_Node.h:1543
OP_ERROR setParentObject(OBJ_Node *node)
Definition: OBJ_Node.h:1333
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:1393
virtual obj_OnionSkin getOnionSkin()
Definition: OBJ_Node.h:723
void setKEEPPOS(int v)
Definition: OBJ_Node.h:1478
GLboolean GLboolean g
Definition: glew.h:9477
void setDisplayDisabledBySubnetNeedsUpdate()
Definition: OBJ_Node.h:1657
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.