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