HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BRAY_Interface.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: BRAY_Interface.h (BRAY Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __BRAY_Interface__
12 #define __BRAY_Interface__
13 
14 #include "BRAY_API.h"
15 #include <UT/UT_Array.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringArray.h>
18 #include <UT/UT_NonCopyable.h>
19 #include <UT/UT_Options.h>
20 #include <UT/UT_SharedPtr.h>
21 #include <UT/UT_IntrusivePtr.h>
22 #include <UT/UT_UniquePtr.h>
23 #include <UT/UT_Rect.h>
24 #include <UT/UT_Set.h>
25 #include <UT/UT_Map.h>
26 #include <UT/UT_VectorTypes.h>
27 #include <GT/GT_Handles.h>
28 #include <GT/GT_DataArray.h>
29 #include <PXL/PXL_Common.h>
30 #include "BRAY_Types.h"
31 
32 // Classes referenced by the interface
33 class BRAY_Procedural;
35 class BRAY_AOVBuffer;
36 class BRAY_Camera;
37 class BRAY_Object;
38 class BRAY_Renderer;
39 class BRAY_Light;
40 class BRAY_Scene;
41 class BRAY_ShaderGraph;
42 class BRAY_ShaderInstance;
43 class BRAY_VexMaterial;
44 class VPRM_Space;
45 class VPRM_OptionSet;
46 class UT_JSONWriter;
47 
50 
51 namespace BRAY
52 {
53 
54 class CameraPtr;
55 class CoordSysPtr;
56 class LightPtr;
57 class MaterialPtr;
58 class ObjectPtr;
59 class ScenePtr;
60 class ShaderGraphPtr;
61 
63 {
64 public:
65  SpacePtr();
66  SpacePtr(const VPRM_SpacePtr &s);
67  SpacePtr(const SpacePtr &s);
68  SpacePtr(const UT_Matrix4D &xforms);
69  SpacePtr(const UT_Matrix4D *xforms, size_t num_motion_segments);
70  ~SpacePtr();
71  SpacePtr &operator=(const SpacePtr &s);
72 
73  /// @{
74  /// Private access
75  bool isValid() const { return mySpace.get() != nullptr; }
76  VPRM_SpacePtr &space() { return mySpace; }
77  const VPRM_SpacePtr &space() const { return mySpace; }
78  /// @}
79  /// Bool operator to test validity of pointer
80  SYS_SAFE_BOOL operator bool() const { return isValid(); }
81 
82  /// Multiply by the given space (i.e. this * sp)
83  SpacePtr mulSpace(const SpacePtr &sp) const;
84 
85  /// Return the number of motion segments
86  int motionSegments() const;
87  const UT_Matrix4D &getTransform(int segment) const;
88  void getTransform(UT_Matrix4D &x, BRAYtime shutter) const;
89  void dump() const;
90  void dump(UT_JSONWriter &w) const;
91 private:
92  VPRM_SpacePtr mySpace;
93 };
94 
95 /// The OptionSet acts as a pointer to an underlying set of options for various
96 /// different object types.
98 {
99 public:
100  OptionSet();
101  /// The copy c-tor will copy the underlying pointer, but refer to the same
102  /// underlying object.
103  OptionSet(const OptionSet &src);
104  OptionSet(const VPRM_OptionSetPtr &o);
105  ~OptionSet();
106 
107  /// The assignment operator will change the pointer to the underlying
108  /// object. Both OptionSets will point to the same underlying object.
109  OptionSet &operator=(const OptionSet &o);
110 
111  /// This will create a new OptionSet, inheriting state information from the
112  /// this option set. Note that changing values in the this set @b may
113  /// result in unexpected changes in the new option set.
114  OptionSet duplicate() const;
115 
116  /// Returns true if property can be erased to revert back to default value.
117  /// If the options aren't inherited (i.e. offline render), it cannot be
118  /// erased.
119  bool canErase(int token) const;
120 
121  /// Erase properties
122  void erase(const UT_Set<int> &tokens);
123 
124  /// @{
125  /// Private access
126  bool isValid() const { return myOptions.get() != nullptr; }
127  VPRM_OptionSetPtr &options() { return myOptions; }
128  const VPRM_OptionSetPtr &options() const { return myOptions; }
129  /// @}
130  /// Bool operator to test validity of pointer
131  SYS_SAFE_BOOL operator bool() const { return isValid(); }
132 
133  /// Return the number of pre-defined properties in the option set
134  exint numProperties() const;
135 
136  /// Return the name associated with a given option (i.e. dicingquality)
137  const UT_StringHolder &name(int token) const;
138 
139  /// Return the fully qualified name (i.e. karma::object::dicingquality)
140  UT_StringHolder fullName(int token) const;
141 
142  /// Return the token associated with a given name (or -1 if invalid)
143  int find(const UT_StringRef &name) const;
144 
145  /// Import a property value. Method is specialized for T in:
146  /// - bool
147  /// - int32/int64
148  /// - fpreal32/fpreal64
149  /// - UT_StringHolder
150  template <typename T>
151  const T *import(int token, T *val, size_t n) const;
152 
153  /// Interface to set an property. This template class is specialized for:
154  /// - bool
155  /// - int32
156  /// - int64
157  /// - fpreal32
158  /// - fpreal64
159  /// - UT_StringHolder
160  template <typename T>
161  bool set(int token, const T *value, exint tuple_size);
162 
163  /// Simple interface to set a scalar property
164  template <typename T>
165  SYS_FORCE_INLINE bool set(int token, const T &value)
166  {
167  return set(token, &value, 1);
168  }
169 
170  /// Test whether a value is the same as the current property
171  template <typename T>
172  bool isEqual(int token, const T *value, exint tuple_size) const;
173 
174  /// Simple interface for equality of a scalar value.
175  template <typename T>
176  SYS_FORCE_INLINE bool isEqual(int token, const T &value) const
177  {
178  return isEqual(token, &value, 1);
179  }
180 
181  /// Test whether an option has variadic arguments
182  bool isVariadic(int token) const;
183 
184  /// Return the size of an option. This can be used for variadics
185  exint size(int token) const;
186 
187  /// Return the storage of an option. This will only be one of:
188  /// - GT_STORE_INVALID
189  /// - GT_STORE_UINT8 (for bool storage)
190  /// - GT_STORE_INT64
191  /// - GT_STORE_REAL64
192  /// - GT_STORE_STRING
193  GT_Storage storage(int token) const;
194 
195  /// @{
196  /// Direct access to internal option data. There are no checks on these
197  /// methods
198  const bool *bval(int token) const;
199  const int64 *ival(int token) const;
200  const fpreal64 *fval(int token) const;
201  const UT_StringHolder *sval(int token) const;
202  /// @}
203 
204  /// @private Debug the options (only available in debug builds)
205  void dump(UT_JSONWriter &w) const;
206 
207 private:
208  VPRM_OptionSetPtr myOptions;
209 };
210 
211 /// When defining materials for face sets, the material specification is
212 /// given by a pair of the @c MaterialPtr and an array of integers. The
213 /// integers specify the list of faces to material and must appear in
214 /// sorted order (smallest to largest).
215 /// Interface to the scene manager
217 {
218 public:
219  ScenePtr() = default;
220  ~ScenePtr();
221 
222  /// Allocate a new scene
223  static ScenePtr allocScene();
224 
225  /// convenience methods to determine which renderer is active (tests
226  /// the value of the BRAY_OPT_ENGINE option)
227  bool isKarmaCPU() const;
228  bool isKarmaXPU() const;
229 
230  /// Test validity
231  bool isValid() const { return myScene.get() != nullptr; }
232 
233  /// Test whether the scene is thread-safe
234  bool threadSafe() const;
235 
236  /// Test whether the renderer supports nested instancing
237  bool nestedInstancing() const;
238 
239  /// Update an object in the scene
240  void updateObject(const ObjectPtr &ptr, BRAY_EventType event);
241 
242  /// Update light object in the scene
243  void updateLight(const LightPtr &ptr, BRAY_EventType event);
244 
245  /// Update camera object in the scene
246  void updateCamera(const CameraPtr &ptr, BRAY_EventType event);
247 
248  /// Update material object in the scene
249  void updateMaterial(const MaterialPtr &ptr, BRAY_EventType event);
250 
251  /// Update coord sys object
252  void updateCoordSys(const CoordSysPtr &ptr, BRAY_EventType event);
253 
254  /// @{
255  /// Set the unit scale for the scene - this is in meters/unit. For
256  /// example, centimeters would be 0.01.
257  void setSceneUnits(fpreal64 units);
258  fpreal64 sceneUnits() const;
259  /// @}
260 
261  /// Forcibly save checkpoint as soon as possible (if checkpointing is enabled)
262  void saveCheckpointASAP();
263 
264  /// Set camera ray visibility. The mask should be a combination of
265  /// - BRAY_RAY_CAMERA
266  /// - BRAY_PROXY_CAMERA
267  /// - BRAY_GUIDE_CAMERA
268  /// For example, (BRAY_RAY_CAMERA|BRAY_GUIDE_CAMERA) will cause guide and
269  /// renderable object to be visible to camera rays, but not proxy objects
270  void setCameraRayMask(BRAY_RayVisibility mask);
271 
272  /// Set shadow ray visibility. The mask should be a combination of
273  /// - BRAY_RAY_SHADOW
274  /// - BRAY_PROXY_SHADOW
275  /// - BRAY_GUIDE_SHADOW
276  /// For example, (BRAY_RAY_SHADOW|BRAY_PROXY_SHADOW) will cause proxy and
277  /// renderable object to cast shadows, but not GUIDE objects.
278  void setShadowRayMask(BRAY_RayVisibility mask);
279 
280  /// Force redicing of displacement and subd surfaces on the next render.
281  /// This will only take effect on the next call to beginRender().
282  void forceRedice();
283 
284  /// @{
285  /// Private access to the underling scene
286  SYS_SAFE_BOOL operator bool() const { return isValid(); }
287  const BRAY_Scene *scenePtr() const { return myScene.get(); }
288  BRAY_Scene *scenePtr() { return myScene.get(); }
289  /// @}
290 
291  /// After changing any options, must commit prior to rendering
292  void commitOptions();
293 
294  /// @{
295  /// Grab a copy of the current scene options
296  OptionSet sceneOptions();
297  const OptionSet constSceneOptions() const;
298  /// @}
299 
300  /// @{
301  /// Grab a copy of the current object properties.
302  OptionSet objectProperties();
303  const OptionSet constObjectProperties() const;
304  /// @}
305 
306  /// @{
307  /// Grab a copy of the current light properties
308  OptionSet lightProperties();
309  const OptionSet constLightProperties() const;
310 
311  /// @{
312  /// Grab a copy of the current camera properties
313  OptionSet cameraProperties();
314  const OptionSet constCameraProperties() const;
315  /// @}
316 
317  /// Grab a copy of the current image plane properties
318  OptionSet planeProperties();
319  const OptionSet constPlaneProperties() const;
320  /// @}
321 
322  /// Grab a the default properties for a given type. Changing their values
323  /// will cause all future objects created to inherit the new values.
324  OptionSet defaultProperties(BRAY_PropertyType type) const;
325 
326  /// @{
327  /// Convenience methods to look up scene and scene options.
328  /// Get an scene option value.
329  template <typename T>
331  T *val, size_t n) const
332  {
333  return constSceneOptions().import(token, val, n);
334  }
335 
336  /// Interface to set an option. This template class is specialized for:
337  template <typename T>
339  const T *value,
340  exint tuple_size)
341  {
342  return sceneOptions().set(token, value, tuple_size);
343  }
344 
345  /// Simple interface to set a scalar option
346  template <typename T>
347  SYS_FORCE_INLINE bool
349  {
350  return setOption(token, &value, 1);
351  }
352 
353  /// Return the size of an option. This can be used for variadics
354  /// (e.g. shading quality will be 1)
356  {
357  return constSceneOptions().size(token);
358  }
359 
360  /// Return the storage class of an option.
363  {
364  return constSceneOptions().storage(token);
365  }
366 
367  /// Return whether an option has variadic arguments
368  SYS_FORCE_INLINE bool
370  {
371  return constSceneOptions().isVariadic(token);
372  }
374  { return *constSceneOptions().bval(t); }
376  { return *constSceneOptions().ival(t); }
378  { return *constSceneOptions().fval(t); }
380  { return *constSceneOptions().sval(t); }
381  /// @}
382 
383  /// @{
384  /// Convenience methods to look up object properties.
385  /// Get an object property value.
386  template <typename T>
388  T *val, size_t n) const
389  {
390  return constObjectProperties().import(token, val, n);
391  }
392 
393  /// Interface to set an property. This template class is specialized for:
394  template <typename T>
396  const T *value,
397  exint tuple_size)
398  {
399  return objectProperties().set(token, value, tuple_size);
400  }
401 
402  /// Locking the object property prevents any overriding of the property
403  /// after the fact, essentially turning the property into a read-only
404  /// property. This method is intended to lock default properties. The
405  /// current value of the property is used as the value.
406  ///
407  /// The return value is the previous lock state of the property.
408  bool lockProperty(BRAY_ObjectProperty token, bool state);
409 
410  /// Lock properties based on a string pattern of parameter names. This
411  /// method returns the number of properties modified.
412  exint lockProperties(const char *pattern, bool state);
413 
414  /// Lock or unlock all object properties.
416  { return lockProperties("*", state); }
417 
418  /// Simple interface to set a scalar property
419  template <typename T>
420  SYS_FORCE_INLINE bool
422  {
423  return setProperty(token, &value, 1);
424  }
425 
426  /// Return the size of an option. This can be used for variadics
427  /// (e.g. shading quality will be 1)
429  {
430  return constObjectProperties().size(token);
431  }
432 
433  /// Return the storage class of an option.
436  {
437  return constObjectProperties().storage(token);
438  }
439 
440  /// Return whether an property has variadic arguments
441  SYS_FORCE_INLINE bool
443  {
444  return constObjectProperties().isVariadic(token);
445  }
447  { return *constObjectProperties().bval(t); }
449  { return *constObjectProperties().ival(t); }
451  { return *constObjectProperties().fval(t); }
453  { return *constObjectProperties().sval(t); }
454  /// @}
455 
456  /// Create a light
457  LightPtr createLight(const UT_StringHolder &name);
458 
459  /// Create a camera
460  CameraPtr createCamera(const UT_StringHolder &name);
461 
462  /// Create a coordinate system
463  CoordSysPtr createCoordSys(const UT_StringHolder &name);
464 
465  /// Create a material
466  MaterialPtr createMaterial(const UT_StringHolder &name);
467 
468  /// Find a material.
469  MaterialPtr findMaterial(const UT_StringRef &name) const;
470 
471  /// Destroy/Delete a material (returns false if material wasn't found)
472  bool destroyMaterial(const UT_StringRef &name);
473 
474  /// Add traceset name to global list (categories on objects that do not
475  /// belong to this list will be ignored)
476  /// Returns true if added, false if already exists.
477  bool addTraceset(const UT_StringHolder &name);
478 
479  /// Check to see if a traceset exists.
480  bool isTraceset(const UT_StringHolder &name);
481 
482  /// Create a shader nodegraph
483  ShaderGraphPtr createShaderGraph(const UT_StringHolder &name);
484 
485  /// Load an HDA to define shader code. Not all applications support this
486  /// feature.
487  bool loadHDA(const char *path);
488 
489 private:
490  UT_SharedPtr<BRAY_Scene> myScene;
491 };
492 
493 /// Input connector for materials. This defines the name of the geometry
494 /// attribute (@c myInputName) to bind to the VEX shader parameter (@c myParmName)
496 {
497  enum class Storage
498  {
499  FLOAT,
500  INTEGER,
501  STRING
502  };
504  const UT_StringHolder &shader_parm,
505  Storage store,
506  int tsize,
507  bool is_array)
508  : myGeometry(primvar)
509  , myParmName(shader_parm)
510  , myStorage(store)
511  , myTupleSize(tsize)
512  , myIsArray(is_array)
513  {
514  }
515 
516  UT_StringHolder myGeometry; // Input name (primvar name)
517  UT_StringHolder myParmName; // Parameter Name (VEX parameter name)
518  Storage myStorage; // Base storage type
519  int myTupleSize; // Element tuple size
520  bool myIsArray; // Whether parameter is an array
521 };
522 
524 
525 /// Interface to scene materials
527 {
528 public:
529  MaterialPtr(BRAY_VexMaterial *mat = nullptr)
530  : myMat(mat)
531  {
532  }
534 
535  bool isValid() const { return myMat != nullptr; }
536 
537  /// @{
538  /// Access to the underling material
539  SYS_SAFE_BOOL operator bool() const { return isValid(); }
540  const BRAY_VexMaterial *materialPtr() const { return myMat; }
541  /// @}
542 
543  /// Update the surface shader and arguments
544  void updateSurface(const ScenePtr &scene,
545  const UT_StringArray &arguments);
546  /// Update the displacement shader and arguments
547  /// Returns true if arguments changed.
548  bool updateDisplace(ScenePtr &scene,
549  const UT_StringArray &arguments);
550 
551  /// Update surface shader VEX code. The @c preload flag is used when other
552  /// shaders in the network might depend on the code being updated.
553  void updateSurfaceCode(const ScenePtr &scene,
554  const UT_StringHolder &name,
555  const UT_StringRef &code,
556  bool preload=false);
557  /// Update displacement shader VEX code The @c preload flag is used when
558  /// other shaders in the network might depend on the code being updated.
559  /// Returns true if the name or the code changed.
560  bool updateDisplaceCode(const ScenePtr &scene,
561  const UT_StringHolder &name,
562  const UT_StringRef &code,
563  bool preload=false);
564 
565  /// Update the surface shader graph
566  void updateSurfaceGraph(const ScenePtr &scene,
567  const UT_StringHolder &name,
568  const ShaderGraphPtr &graphptr);
569  /// Update the displacement shader graph
570  /// Returns true if the name or the code changed.
571  bool updateDisplaceGraph(ScenePtr &scene,
572  const UT_StringHolder &name,
573  const ShaderGraphPtr &graphptr);
574 
575  /// Set the material input list
576  void setInputs(const ScenePtr &scene,
577  const MaterialInputList &inputs,
578  bool for_surface);
579 
580  /// Set the mapping for transform space aliases. This allows shaders to
581  /// reference a simple space name rather than the fully qualified path to
582  /// the space (e.g. "paintSpace" instead of "/World/Obj/PaintObj/Xform")
583  void setCoordSysAliases(const ScenePtr &scene,
585 
586 private:
587  BRAY_VexMaterial *myMat;
588 };
589 
591 {
593  const MaterialPtr &material = MaterialPtr())
594  : myFaceList(facelist)
595  , myMaterial(material)
596  {
597  }
600 };
601 
603 {
604 public:
605  ObjectPtr() = default;
606  ~ObjectPtr();
607 
608  /// Create an object given a GT_Primitive handle.
609  /// At the current time, the only classes supported are:
610  /// - GT_PrimPolygonMesh
611  /// - GT_PrimSubdivisionMesh
612  /// - GT_PrimCurveMesh
613  /// - GT_PrimPointMesh
614  /// The method will return a nullptr if it can't create a primitive
615  static ObjectPtr createGeometry(const GT_PrimitiveHandle &prim);
616 
617  /// For polygonal meshes, use this to create geometry to handle holes
618  static ObjectPtr createGeometry(const GT_PrimitiveHandle &prim,
619  const GT_DataArrayHandle &holes);
620 
621  /// Create a volume given its detail attribute and the names and
622  /// GT_PrimitiveHandles of the corresponding fields in the volume
624  static ObjectPtr createVolume(const UT_StringHolder &name);
625 
626  /// Create an instance of an object
627  static ObjectPtr createInstance(const ObjectPtr &obj,
628  const UT_StringHolder &name);
629 
630  /// Create a nested scene graph
631  static ObjectPtr createScene();
632 
633  /// Create a procedural object.
634  /// Ownership of the procedural is passed to the object.
635  static ObjectPtr createProcedural(UT_UniquePtr<BRAY_Procedural> proc);
636 
637  /// Test validity
638  bool isValid() const { return myObject != nullptr; }
639 
640  /// Query if object is a leaf node (ie not scenegraph or instance)
641  bool isLeaf() const;
642 
643  /// @{
644  /// Access to the underlying object
645  SYS_SAFE_BOOL operator bool() const { return isValid(); }
646  const BRAY_Object *objectPtr() const { return myObject.get(); }
647  BRAY_Object *objectPtr() { return myObject.get(); }
648  /// @}
649 
650  /// Bind a material to the object. The method will fail if the underlying
651  /// object cannot set the material.
652  bool setMaterial(ScenePtr &scene,
653  const MaterialPtr &mat,
654  const OptionSet &opts,
655  exint nfacesets=0,
656  const FacesetMaterial *faceset_mat=nullptr);
657 
658  /// Set the prototype for an instance object
659  void setInstancePrototype(const ObjectPtr &proto);
660 
661  /// Set the transform on the instance
662  void setInstanceTransforms(ScenePtr &scene,
663  const UT_Array<SpacePtr> &xforms);
664 
665  /// Set attributes on instances
666  void setInstanceAttributes(const ScenePtr &scene,
667  const GT_AttributeListHandle &alist);
668 
669  /// Set property overrides for instances. The array must have an entry for
670  /// every instance. It's possible to have default options. Each
671  /// attribute's name should match an object property name. Warnings will
672  /// be output if an attribute doesn't match.
673  void setInstanceProperties(const ScenePtr &scene,
674  const GT_AttributeListHandle &alist);
675 
676  /// Set instance IDs. If not set (or given an empty array), it is assumed
677  /// that the ids are contiguous 0...N-1 where N is the number of xforms.
678  void setInstanceIds(UT_Array<exint> ids);
679 
680  /// Add an object to a scene
681  void addInstanceToScene(ObjectPtr &obj);
682 
683  /// Check to make sure that number of xforms, attribute list, ids all match
684  bool validateInstance() const;
685 
686  /// @{
687  /// This will return the object's base properties, or the scene defaults if
688  /// the object isn't defined yet.
689  OptionSet objectProperties(ScenePtr &scene);
690  const OptionSet objectProperties(const ScenePtr &scene) const;
691  /// @}
692 
693  /// Get the underlying GT_PrimitiveHandle (if possible). This method may
694  /// return a nullptr.
695  GT_PrimitiveHandle geometry() const;
696 
697  /// Pointer to the contained procedural. This may return a nullptr.
698  BRAY_Procedural *procedural();
699 
700  /// Update the geometry for the object. The method will fail if you're
701  /// trying to change the underlying primitive type.
702  bool setGeometry(const ScenePtr &scene,
703  const GT_PrimitiveHandle &prim);
704 
705  /// Set the list of "holes" for a polygon mesh (subdivision meshes have the
706  /// list of holes specified in the subdivision tags).
707  bool setGeometry(const ScenePtr &scene,
708  const GT_PrimitiveHandle &prim,
709  const GT_DataArrayHandle &holes);
710 
711  /// Update volume fields. This method will fail if the underlying
712  /// primitive isn't a volume (see createVolume())
713  bool setVolume(const ScenePtr &scene,
714  const GT_AttributeListHandle &clist,
715  const FieldList& fields);
716 
717  /// Return the detail attributes for a volume primitive
718  const GT_AttributeListHandle &volumeDetailAttributes() const;
719 
720  /// TODO: Deprecate this
721  void takeOwnership(BRAY_Object *obj);
722 
723 protected:
725 };
726 
728 {
729 public:
731  : myLight(lp)
732  {
733  }
734  ~LightPtr();
735 
736  /// Test validity
737  bool isValid() const { return myLight != nullptr; }
738 
739  /// @{
740  /// Access to the underlying object
741  SYS_SAFE_BOOL operator bool() const { return isValid(); }
742  const BRAY_Light *lightPtr() const { return myLight.get(); }
743  BRAY_Light *lightPtr() { return myLight.get(); }
744  /// @}
745 
746  /// Return the type of light
747  BRAY_LightType type() const;
748 
749  /// Set the transform on the instance
750  void setTransform(const SpacePtr &xforms);
751 
752  /// Set the shader for the light
753  void setShader(const ScenePtr &scene, const UT_StringArray &args);
754 
755  /// Get the current object properties for modification.
756  OptionSet objectProperties();
757 
758  /// Get the current light properties for modification.
759  OptionSet lightProperties();
760 
761  /// After changing any options, must lock prior to rendering
762  void commitOptions(ScenePtr &scene);
763 
764  /// Update the light shader graph
765  void updateShaderGraph(const ScenePtr &scene,
766  const ShaderGraphPtr &graphptr,
767  const UT_Array<ShaderGraphPtr> &light_filters);
768 
769  /// If a light filter has been modified, this method should be called to
770  /// notify the light. The set should contain the names of the dirty light
771  /// filter shader graphs.
772  void updateFilters(const ScenePtr &scene,
773  const UT_Array<ShaderGraphPtr> &filters);
774 
775  /// Notify the light that a filter has been deleted
776  void eraseFilter(const ScenePtr &scene,
777  const UT_StringRef &shader_graph_name);
778 
779 protected:
781 };
782 
784 {
785 public:
787  : myCamera(cp)
788  {
789  }
790  ~CameraPtr();
791 
792  /// Test validity
793  bool isValid() const { return myCamera != nullptr; }
794 
795  /// @{
796  /// Access to the underlying object
797  SYS_SAFE_BOOL operator bool() const { return isValid(); }
798  const BRAY_Camera *cameraPtr() const { return myCamera.get(); }
799  BRAY_Camera *cameraPtr() { return myCamera.get(); }
800  /// @}
801 
802  /// Set the transform on the camera
803  void setTransform(ScenePtr &ptr, const SpacePtr &xforms);
804 
805  /// Set the lens shader for the camera
806  void setShader(const ScenePtr &scene, const UT_StringArray &args);
807 
808  /// Get the current object properties for modification.
809  OptionSet objectProperties();
810 
811  /// Set number of motion samples for animated camera properties (1 upon
812  /// construction). The last motion sample is assumed to have time offset of
813  /// 1.0. (eg. if there are 3 samples, the time offsets are: 0, 0.5, 1.0)
814  void resizeCameraProperties(int nseg);
815 
816  /// Get the current camera properties for modification.
817  UT_Array<OptionSet> cameraProperties();
818 
819  /// After changing any options, must lock prior to rendering
820  void commitOptions(ScenePtr &scene);
821 
822 protected:
824 
825 };
826 
828 {
829 public:
831  : mySpace(sp)
832  {
833  }
834  ~CoordSysPtr();
835 
836  /// Test validity
837  bool isValid() const { return mySpace != nullptr; }
838 
839 
840  /// @{
841  /// Access to underlying object
842  SYS_SAFE_BOOL operator bool() const { return isValid(); }
843  const BRAY_Camera *spacePtr() const { return mySpace.get(); }
844  BRAY_Camera *spacePtr() { return mySpace.get(); }
845  /// @}
846 
847  const UT_StringHolder &name() const;
848 
849  /// Set transform
850  void setTransform(ScenePtr &scn, const SpacePtr &xforms);
851 
852  /// The current object properties for modification (primarily for motion
853  /// blur settings)
854  OptionSet objectProperties();
855 
856  /// When a transform space has camera properties (for projection spaces),
857  /// it's possible the projection can be motion blurred. This allows you to
858  /// specify the motion segments for properties.
859  void resizeCameraProperties(int nseg);
860 
861  /// Get the current camera properties for modification
862  UT_Array<OptionSet> cameraProperties();
863 
864  /// After changing options, make sure to commit
865  void commit(ScenePtr &scene);
866 
867 private:
869 };
870 
872 {
873 public:
874  AOVBufferPtr() = default;
875 
877  : myAOVBuffer(aov)
878  {}
879 
881 
882  bool operator==(const AOVBufferPtr &aov) const
883  { return aov.myAOVBuffer == myAOVBuffer; }
884  bool operator!=(const AOVBufferPtr &aov) const
885  { return !(*this == aov); }
886 
887  const UT_StringHolder &getName() const;
888  const UT_StringHolder &getVariable() const;
889 
890  int getXres() const;
891  int getYres() const;
892  PXL_DataFormat getFormat() const;
893  PXL_Packing getPacking() const;
894  float getDefaultValue() const;
895 
896  void *map();
897  void unmap();
898  bool isMapped() const;
899 
900  // For extra channels
901  int getNumExtra() const;
902  const UT_StringHolder &nameExtra(int idx) const;
903  PXL_DataFormat getFormatExtra(int idx) const;
904  PXL_Packing getPackingExtra(int idx) const;
905  void *mapExtra(int idx);
906  void unmapExtra(int idx);
907 
908  // metadata to write to header of output file
909  const UT_Options &getMetadata() const;
910 
911  bool isConverged() const;
912  void setConverged();
913  void clearConverged();
914 
915  // Valid only after raster is allocated (ie render started)
916  bool isValid() const;
917 
918  SYS_SAFE_BOOL operator bool() const { return isValid(); }
919 
920 private:
921  UT_SharedPtr<BRAY_AOVBuffer> myAOVBuffer;
922 };
923 
924 /// A render product represents an output file
926 {
927 public:
928  // Test whether the type is understook by karma
929  // For example "karma:checkpoint"
930  static bool isKnownType(const UT_StringRef &type);
931 
932  // Clear all existing output files
933  static void clearFiles(BRAY::ScenePtr &scene);
934 
935  struct BRAY_API AOV
936  {
938  : myName(name)
939  {
940  }
941  /// Method is specialized for T in:
942  /// - bool
943  /// - int32/int64
944  /// - fpreal32/fpreal64
945  /// - UT_StringHolder
946  template <typename T>
947  bool setOption(const UT_StringHolder &name,
948  const T *value,
949  exint size);
950  template <typename T>
951  bool setOption(const UT_StringHolder &name, const T &value)
952  { return setOption(name, &value, 1); }
953 
954  /// Copy over options from those passed in
955  bool setOptions(const UT_Options &options);
956 
957  const UT_StringHolder &name() const { return myName; }
958  const UT_Options &options() const { return myOptions; }
959 
960  /// Dump method for debugging
961  void dump(UT_JSONWriter &w) const;
962  private:
963  UT_StringHolder myName;
964  UT_Options myOptions;
965  };
967  const UT_StringHolder &filename,
968  const UT_StringHolder &type)
969  : myScene(scene)
970  , myFilename(filename)
971  , myType(type)
972  {
973  }
974 
976  {
977  if (myFilename)
978  commit();
979  }
980 
981  /// @{
982  /// Method is specialized for T in:
983  /// - bool
984  /// - int32/int64
985  /// - fpreal32/fpreal64
986  /// - UT_StringHolder
987  template <typename T>
988  bool setOption(const UT_StringHolder &name,
989  const T *value,
990  exint size);
991  template <typename T>
992  bool setOption(const UT_StringHolder &name, const T &value)
993  { return setOption(name, &value, 1); }
994  /// @}
995 
996  /// Copy over options from those passed in
997  bool setOptions(const UT_Options &options);
998 
999  /// Add an AOV to this output file
1001  {
1002  myAOVs.emplace_back(name);
1003  return myAOVs.last();
1004  }
1005 
1006  /// Commit and add this output file to the render
1007  bool commit()
1008  {
1009  bool result = doCommit();
1010  cancel(); // Once committed, no more changes
1011  return result;
1012  }
1013  /// Cancel this output file for some reason
1014  void cancel() { myFilename.clear(); }
1015 
1016  /// Access member data
1017  const UT_StringHolder &filename() const { return myFilename; }
1018  const UT_StringHolder &type() const { return myType; }
1019  const UT_Array<AOV> &aovs() const { return myAOVs; }
1020  const UT_Options &options() const { return myOptions; }
1021 
1022  /// @{
1023  /// Dump information (used by karma:debug)
1024  void dump() const;
1025  void dump(UT_JSONWriter &w) const;
1026  /// @}
1027 
1028 private:
1029  bool doCommit();
1030  BRAY::ScenePtr &myScene;
1031  UT_StringHolder myFilename;
1032  UT_StringHolder myType;
1033  UT_Array<AOV> myAOVs;
1034  UT_Options myOptions;
1035 };
1036 
1037 
1038 /// Interface to the renderer
1040 {
1041 public:
1042  /// Class used to define image planes
1043  struct ImagePlane
1044  {
1047  int mySize;
1050  };
1051 
1052  struct Stats
1053  {
1055  {
1061  };
1062 
1064  {
1065  clear();
1066  myFrameCount = 0;
1067  }
1068  void clear()
1069  {
1070  myWorldToCamera = UT_Matrix4D(1);
1071  myWorldToScreen = UT_Matrix4D(1);
1072  myWorldToNDC = UT_Matrix4D(1);
1073  myWorldToRaster = UT_Matrix4D(1);
1074  myStage = STAGE_INACTIVE;
1075  myPercentDone = 0;
1076  myCameraRays = 0;
1077  myIndirectRays = 0;
1078  myOcclusionRays = 0;
1079  myLightGeoRays = 0;
1080  myProbeRays = 0;
1081  myDisplaceShadeCount = 0;
1082  mySurfaceShadeCount = 0;
1083  myOpacityShadeCount = 0;
1084  myLightShadeCount = 0;
1085  myEmissionShadeCount = 0;
1086  myVolumeShadeCount = 0;
1087  myPolyCount = UT_Vector2I(0, 0);
1088  myCurveCount = UT_Vector2I(0, 0);
1089  myPointCount = UT_Vector2I(0, 0);
1090  myPointMeshCount = UT_Vector2I(0, 0);
1091  myVolumeCount = UT_Vector2I(0, 0);
1092  myProceduralCount = UT_Vector2I(0, 0);
1093  myLightCount = 0;
1094  myLightTreeCount = 0;
1095  myCameraCount = 0;
1096  myCoordSysCount = 0;
1097  myOctreeBuildTime = 0;
1098  myLoadWallClock = 0;
1099  myLoadCPU = 0;
1100  myLoadSystem = 0;
1101  myLoadMemory = 0;
1102  myTTFP = 0;
1103  myTotalWallClock = 0;
1104  myTotalCPU = 0;
1105  myTotalSystem = 0;
1106  myCurrentMemory = 0;
1107  myPeakMemory = 0;
1108  myObjectCountsSet = false;
1109  myFilterErrors.clear();
1110  myPrimvar.clear();
1111  myDetailedTimes.clear();
1112  myRenderProgressAnnotation.clear();
1113  myRenderStatsAnnotation.clear();
1114  myRenderSettings.clear();
1115  }
1116 
1117  /// Transform matrices
1122 
1123  /// Current state of rendering
1125 
1126  /// Total number of frames rendered
1128 
1129  /// Percent complete of current frame
1131 
1132  /// Ray counts
1138 
1145 
1146  /// Object counts -- only defined if verbose >= 2
1147  UT_Vector2I myPolyCount; // Individual/Instances
1148  UT_Vector2I myCurveCount; // Individual/Instances
1149  UT_Vector2I myPointCount; // Individual/Instances
1150  UT_Vector2I myPointMeshCount; // Individual/Instances
1151  UT_Vector2I myVolumeCount; // Individual/Instances
1152  UT_Vector2I myProceduralCount; // Individual/Instances
1154  int64 myLightCount; // Total lights in the scene
1155  int64 myLightTreeCount; // Lights in the light tree
1156  int64 myCameraCount; // Cameras in the scene
1157  int64 myCoordSysCount; // Coordinate systems in the scene
1158 
1159  /// Times
1160  fpreal myOctreeBuildTime; // Time to build octree
1161 
1162  /// Initialization times
1163  fpreal myLoadWallClock; // Wall clock time for load
1164  fpreal myLoadCPU; // CPU time for load
1165  fpreal myLoadSystem; // System time for load
1166  int64 myLoadMemory; // Memory after load
1167 
1168  /// Render times
1169  fpreal myTTFP; // Time to first pixel
1170  fpreal myTotalWallClock; // Wall clock time for render
1171  fpreal myTotalCPU; // CPU time for load
1172  fpreal myTotalSystem; // System time for load
1173  int64 myCurrentMemory; // Current memory
1174 
1175  int64 myPeakMemory; // Memory after load
1176 
1177  // Whether myPolyCount, myCurveCount etc. are set
1179 
1180  // Errors from image/pixel/sample filters
1182 
1183  // Primvar memory usage
1185 
1186  /// Detailed times if verbose >= 4
1188 
1189  // Accelerator stats
1192 
1193  // Render settings
1194  UT_StringHolder myRenderSettings; // multi-line JSON
1195  };
1196 
1197  RendererPtr() = default;
1199 
1200  /// Allocate renderer
1201  static RendererPtr allocRenderer(BRAY::ScenePtr &sceneptr);
1202 
1203  SYS_SAFE_BOOL operator bool() const { return myRenderer.get(); }
1204 
1205  /// @{
1206  /// Define image planes for rendering
1207  void clearOutputPlanes();
1208  AOVBufferPtr addOutputPlane(const ImagePlane &plane);
1209  int getAOVCount() const;
1210  /// @}
1211 
1212  /// Return stats about rendering
1213  const Stats &renderStats() const;
1214 
1215  /// Call before rendering begins. This lets the renderer prepare data
1216  /// structures before render() is called. For example, this will ensure
1217  /// all AOV buffers are allocated and active. The method returns false if
1218  /// there were errors setting up the render.
1219  bool prepareRender();
1220 
1221  /// Start rendering a scene
1222  void render(bool (*stopreq)(void *) = nullptr, void *data = nullptr);
1223 
1224  /// Test to see whether the current renderer is active
1225  bool isRendering() const;
1226 
1227  /// Test to see if there was an error rendering
1228  bool isError() const;
1229 
1230  /// Test to see if the renderer is paused
1231  bool isPaused() const;
1232 
1233  /// Tells the renderer to prepare to be stopped
1234  void prepareForStop();
1235 
1236  /// Pause rendering -- Returns true if the renderer is paused
1237  bool pauseRender();
1238 
1239  /// Restart rendering -- Returns true if @c isRendering();
1240  bool resumeRender();
1241 
1242  /// Set a point in the image to give priority to rendering
1243  void setPriority(int x, int y);
1244 
1245  /// Set a region in the image which should have priority
1246  void setPriority(const UT_DimRect &region);
1247 
1248  /// Clear the priority focus
1249  void clearPriority();
1250 
1251 private:
1252  UT_SharedPtr<BRAY_Renderer> myRenderer;
1253 };
1254 
1256 {
1257 public:
1259  : myGraph(graph)
1260  {}
1262 
1263  /// Make new node based on type and add to list of nodes in the current
1264  /// graph. Returns NULL if unknown type.
1265  /// Note that the root node (ie with surface/displace output) must be the
1266  /// first node added to the graph.
1267  BRAY_ShaderInstance *createNode(const UT_StringHolder &type,
1268  const UT_StringHolder &name);
1269 
1270  /// Returns OptionSet that contains input parameters for given shader node.
1271  /// Can be used to read and write values.
1272  OptionSet nodeParams(BRAY_ShaderInstance *node);
1273 
1274  /// Make connection between two nodes
1275  bool wireNodes(const UT_StringHolder &srcnode,
1276  const UT_StringHolder &srcoutput,
1277  const UT_StringHolder &dstnode,
1278  const UT_StringHolder &dstinput);
1279 
1280  // Definition of a shader node
1281  class NodeDecl
1282  : UT_NonCopyable
1283  {
1284  public:
1287  : myName(n)
1288  {
1289  }
1290 
1291  struct Parameter
1292  {
1293  UT_StringHolder myName; // Name of parameter
1294 
1295  bool isBool() const { return myType == 0; }
1296  bool isInt() const { return myType == 1; }
1297  bool isReal() const { return myType == 2; }
1298  bool isFloat() const { return myType == 2; }
1299  bool isString() const { return myType == 3; }
1300  bool isVariadic() const { return myVariadic; }
1301 
1302  exint size() const
1303  {
1304  return myB.size() + myI.size() + myF.size() + myS.size();
1305  }
1306 
1307  UT_Array<bool> myB; // Bool defaults
1308  UT_Array<int64> myI; // Integer defaults
1309  UT_Array<fpreal64> myF; // Real defaults
1310  UT_Array<UT_StringHolder> myS; // String defaults
1311  bool myVariadic; // Array valued (variadic)
1314 
1315  void dump(UT_JSONWriter &w) const;
1316  };
1317 
1318  const UT_StringHolder name() const { return myName; }
1319  const UT_Array<Parameter> &inputs() const { return myInputs; }
1320  const UT_Array<Parameter> &outputs() const { return myOutputs; }
1321 
1322  void setName(const UT_StringHolder &n) { myName = n; }
1323  void addInput(const Parameter &parm) { myInputs.append(parm); }
1324  void addOutput(const Parameter &parm) { myOutputs.append(parm); }
1325 
1326  void dump() const;
1327  void dump(UT_JSONWriter &w) const;
1328 
1329  private:
1330  UT_StringHolder myName;
1331  UT_Array<Parameter> myInputs;
1332  UT_Array<Parameter> myOutputs;
1333  };
1334 
1335  // Extract the definition of all supported nodes
1336  static const UT_Array<const NodeDecl *> &allNodes();
1337  // Find a node given the name
1338  static const NodeDecl *findNode(const UT_StringRef &name);
1339 
1340 private:
1341  friend class MaterialPtr;
1342  friend class LightPtr;
1344 };
1345 
1346 
1347 }; // End of namespace
1348 
1349 #endif
int64 myCameraRays
Ray counts.
void cancel()
Cancel this output file for some reason.
BRAY_EventType
Types of events that can be sent as updates to the renderer.
Definition: BRAY_Types.h:39
UT_Vector2T< int64 > UT_Vector2I
AOV & appendAOV(const UT_StringHolder &name)
Add an AOV to this output file.
GT_Storage
Definition: GT_Types.h:18
UT_Matrix4T< fpreal64 > UT_Matrix4D
UT_StringHolder optionS(BRAY_SceneOption t) const
int64 propertyI(BRAY_SceneOption t) const
GT_API const UT_StringHolder filename
fpreal myOctreeBuildTime
Times.
const BRAY_Camera * spacePtr() const
GLintptr GLsizeiptr GLboolean commit
Definition: glcorearb.h:3363
Interface to scene materials.
const VPRM_SpacePtr & space() const
bool operator==(const AOVBufferPtr &aov) const
SYS_FORCE_INLINE const T * propertyImport(BRAY_ObjectProperty token, T *val, size_t n) const
const BRAY_Scene * scenePtr() const
bool commit()
Commit and add this output file to the render.
const BRAY_Camera * cameraPtr() const
void setName(const UT_StringHolder &n)
void addOutput(const Parameter &parm)
GLuint segment
Definition: glew.h:12701
bool isValid() const
Test validity.
float BRAYtime
Consistent representation of time type within BRAY.
Definition: BRAY_Types.h:647
UT_Vector2I myPolyCount
Object counts – only defined if verbose >= 2.
VPRM_SpacePtr & space()
BRAY_Light * lightPtr()
BRAY_RayVisibility
Ray visibility flags.
Definition: BRAY_Types.h:692
bool operator!=(const AOVBufferPtr &aov) const
SYS_FORCE_INLINE bool setProperty(BRAY_ObjectProperty token, const T &value)
Simple interface to set a scalar property.
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
AOV(const UT_StringHolder &name)
UT_SharedPtr< BRAY_Light > myLight
FacesetMaterial(const GT_DataArrayHandle &facelist=GT_DataArrayHandle(), const MaterialPtr &material=MaterialPtr())
int64 exint
Definition: SYS_Types.h:125
const UT_Options & options() const
CoordSysPtr(const UT_SharedPtr< BRAY_Camera > &sp=UT_SharedPtr< BRAY_Camera >())
const UT_Array< AOV > & aovs() const
const UT_StringHolder & name() const
SYS_FORCE_INLINE const T * optionImport(BRAY_SceneOption token, T *val, size_t n) const
const UT_StringHolder & filename() const
Access member data.
bool setOption(const UT_StringHolder &name, const T &value)
UT_StringHolder myGeometry
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:35
int64 optionI(BRAY_SceneOption t) const
GLuint const GLchar * name
Definition: glcorearb.h:786
SYS_FORCE_INLINE bool set(int token, const T &value)
Simple interface to set a scalar property.
const BRAY_Object * objectPtr() const
GLenum src
Definition: glcorearb.h:1793
SYS_FORCE_INLINE exint propertySize(BRAY_ObjectProperty token) const
const UT_Array< Parameter > & inputs() const
GLdouble GLdouble t
Definition: glew.h:1403
const BRAY_Light * lightPtr() const
OutputFile(BRAY::ScenePtr &scene, const UT_StringHolder &filename, const UT_StringHolder &type)
bool isValid() const
Test validity.
UT_Matrix4D myWorldToCamera
Transform matrices.
CameraPtr(const UT_SharedPtr< BRAY_Camera > &cp=UT_SharedPtr< BRAY_Camera >())
IFDmantra you can see code vm_image_mplay_direction endcode When SOHO starts a render
Definition: HDK_Image.dox:266
const BRAY_VexMaterial * materialPtr() const
SYS_FORCE_INLINE bool isEqual(int token, const T &value) const
Simple interface for equality of a scalar value.
UT_StringHolder propertyS(BRAY_SceneOption t) const
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
GLint GLenum GLint x
Definition: glcorearb.h:409
bool isValid() const
Test validity.
struct _cl_event * event
Definition: glcorearb.h:2961
GLsizeiptr size
Definition: glcorearb.h:664
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
UT_StringHolder myParmName
double fpreal64
Definition: SYS_Types.h:201
unsigned char uint8
Definition: SYS_Types.h:36
bool propertyB(BRAY_SceneOption t) const
VPRM_OptionSetPtr & options()
const UT_StringHolder name() const
GLuint64EXT * result
Definition: glew.h:14311
BRAY_ObjectProperty
Definition: BRAY_Types.h:185
SYS_FORCE_INLINE GT_Storage propertyStorage(BRAY_ObjectProperty token) const
Return the storage class of an option.
UT_SharedPtr< BRAY_Camera > myCamera
UT_SharedPtr< BRAY_Object > myObject
#define SYS_SAFE_BOOL
Definition: SYS_Compiler.h:55
BRAY_Camera * cameraPtr()
bool isValid() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
BRAY_Camera * spacePtr()
UT_IntrusivePtr< GT_DataArray > GT_DataArrayHandle
Definition: GT_DataArray.h:32
GLint GLuint mask
Definition: glcorearb.h:124
SYS_FORCE_INLINE exint optionSize(BRAY_SceneOption token) const
int setVolume(int speaker, float vol) override
ShaderGraphPtr(UT_SharedPtr< BRAY_ShaderGraph > graph)
bool isValid() const
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
GLhandleARB obj
Definition: glew.h:6266
fpreal myTTFP
Render times.
NodeDecl(const UT_StringHolder &n)
SYS_FORCE_INLINE bool optionIsVariadic(BRAY_SceneOption token) const
Return whether an option has variadic arguments.
PXL_Packing
Definition: PXL_Common.h:30
SYS_FORCE_INLINE bool setOption(BRAY_SceneOption token, const T *value, exint tuple_size)
Interface to set an option. This template class is specialized for:
long long int64
Definition: SYS_Types.h:116
SYS_FORCE_INLINE exint lockAllObjectProperties(bool state)
Lock or unlock all object properties.
int myFrameCount
Total number of frames rendered.
const UT_Array< Parameter > & outputs() const
fpreal myLoadWallClock
Initialization times.
bool isValid() const
Test validity.
Class used to define image planes.
MaterialInput(const UT_StringHolder &primvar, const UT_StringHolder &shader_parm, Storage store, int tsize, bool is_array)
PXL_DataFormat
Definition: PXL_Common.h:20
GLuint * ids
Definition: glcorearb.h:652
const UT_Options & options() const
UT_StringHolder myRenderStatsAnnotation
GT_DataArrayHandle myFaceList
GLdouble n
Definition: glcorearb.h:2008
GLubyte * pattern
Definition: glew.h:5741
BRAY_LightType
Definition: BRAY_Types.h:532
SYS_FORCE_INLINE bool setOption(BRAY_SceneOption token, const T &value)
Simple interface to set a scalar option.
fpreal myPercentDone
Percent complete of current frame.
GLuint GLfloat * val
Definition: glcorearb.h:1608
A map of string to various well defined value types.
Definition: UT_Options.h:84
A render product represents an output file.
BRAY_SceneOption
Definition: BRAY_Types.h:66
UT_StringHolder myDetailedTimes
Detailed times if verbose >= 4.
bool isValid() const
fpreal64 fpreal
Definition: SYS_Types.h:277
fpreal64 optionF(BRAY_SceneOption t) const
MaterialPtr(BRAY_VexMaterial *mat=nullptr)
SYS_FORCE_INLINE bool setProperty(BRAY_ObjectProperty token, const T *value, exint tuple_size)
Interface to set an property. This template class is specialized for:
AOVBufferPtr(const UT_SharedPtr< BRAY_AOVBuffer > &aov)
auto ptr(T p) -> const void *
Definition: format.h:2448
SYS_FORCE_INLINE bool propertyIsVariadic(BRAY_ObjectProperty token) const
Return whether an property has variadic arguments.
#define BRAY_API
Definition: BRAY_API.h:12
bool isValid() const
Test validity.
**If you just want to fire and args
Definition: thread.h:609
BRAY_PropertyType
Definition: BRAY_Types.h:359
void addInput(const Parameter &parm)
getOption("OpenEXR.storage") storage
Definition: HDK_Image.dox:276
RenderStage myStage
Current state of rendering.
Definition: core.h:1131
bool setOption(const UT_StringHolder &name, const T &value)
GLfloat units
Definition: glcorearb.h:408
MX_GENSHADER_API const TypeDesc * INTEGER
UT_StringHolder myRenderSettings
bool optionB(BRAY_SceneOption t) const
Interface to the renderer.
type
Definition: core.h:1059
UT_StringHolder myRenderProgressAnnotation
const UT_StringHolder & type() const
fpreal64 propertyF(BRAY_SceneOption t) const
GLdouble s
Definition: glew.h:1395
GLint y
Definition: glcorearb.h:103
Definition: format.h:895
const VPRM_OptionSetPtr & options() const
BRAY_Object * objectPtr()
BRAY_Scene * scenePtr()
UT_StringArray myFilterErrors
LightPtr(const UT_SharedPtr< BRAY_Light > &lp=UT_SharedPtr< BRAY_Light >())
SYS_FORCE_INLINE GT_Storage optionStorage(BRAY_SceneOption token) const
Return the storage class of an option.
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
Definition: core.h:2089