11 #ifndef __BRAY_Interface__
12 #define __BRAY_Interface__
42 class BRAY_ShaderGraph;
43 class BRAY_ShaderInstance;
44 class BRAY_VexMaterial;
86 bool isValid()
const {
return mySpace.get() !=
nullptr; }
97 int motionSegments()
const;
130 bool canErase(
int token)
const;
137 bool isValid()
const {
return myOptions.get() !=
nullptr; }
145 exint numProperties()
const;
161 template <
typename T>
162 const T *
import(
int token,
T *
val,
size_t n)
const;
171 template <
typename T>
172 bool set(
int token,
const T *
value,
exint tuple_size);
175 template <
typename T>
178 return set(token, &value, 1);
182 template <
typename T>
183 bool isEqual(
int token,
const T *
value,
exint tuple_size)
const;
186 template <
typename T>
189 return isEqual(token, &value, 1);
193 bool isVariadic(
int token)
const;
209 const bool *bval(
int token)
const;
210 const int64 *ival(
int token)
const;
211 const fpreal64 *fval(
int token)
const;
238 static void setExitOnFailedLicense(
bool state=
true);
245 bool isKarmaCPU()
const;
246 bool isKarmaXPU()
const;
252 bool isValid()
const {
return myScene.get() !=
nullptr; }
255 bool threadSafe()
const;
258 bool nestedInstancing()
const;
283 void saveCheckpointASAP();
308 const BRAY_Scene *
scenePtr()
const {
return myScene.get(); }
313 void commitOptions();
318 const OptionSet constSceneOptions()
const;
324 const OptionSet constObjectProperties()
const;
330 const OptionSet constLightProperties()
const;
335 const OptionSet constCameraProperties()
const;
340 const OptionSet constPlaneProperties()
const;
350 template <
typename T>
352 T *
val,
size_t n)
const
354 return constSceneOptions().import(token, val, n);
358 template <
typename T>
363 return sceneOptions().set(token, value, tuple_size);
367 template <
typename T>
371 return setOption(token, &value, 1);
378 return constSceneOptions().size(token);
385 return constSceneOptions().storage(token);
392 return constSceneOptions().isVariadic(token);
395 {
return *constSceneOptions().bval(t); }
397 {
return *constSceneOptions().ival(t); }
399 {
return *constSceneOptions().fval(t); }
401 {
return *constSceneOptions().sval(t); }
407 template <
typename T>
409 T *
val,
size_t n)
const
411 return constObjectProperties().import(token, val, n);
415 template <
typename T>
420 return objectProperties().set(token, value, tuple_size);
437 {
return lockProperties(
"*", state); }
440 template <
typename T>
444 return setProperty(token, &value, 1);
451 return constObjectProperties().size(token);
458 return constObjectProperties().storage(token);
465 return constObjectProperties().isVariadic(token);
468 {
return *constObjectProperties().bval(t); }
470 {
return *constObjectProperties().ival(t); }
472 {
return *constObjectProperties().fval(t); }
474 {
return *constObjectProperties().sval(t); }
542 bool loadHDA(
const char *
path);
563 : myGeometry(primvar)
564 , myParmName(shader_parm)
567 , myIsArray(is_array)
590 bool isValid()
const {
return myMat !=
nullptr; }
599 void updateSurface(
const ScenePtr &scene,
603 bool updateDisplace(
ScenePtr &scene,
606 void updateLens(
const ScenePtr &scene,
611 void updateSurfaceCode(
const ScenePtr &scene,
618 bool updateDisplaceCode(
const ScenePtr &scene,
624 void updateLensCode(
const ScenePtr &scene,
630 void updateSurfaceGraph(
const ScenePtr &scene,
635 bool updateDisplaceGraph(
ScenePtr &scene,
639 void updateLensGraph(
const ScenePtr &scene,
644 void setInputs(
const ScenePtr &scene,
651 void setCoordSysAliases(
const ScenePtr &scene,
655 BRAY_VexMaterial *myMat;
662 : myFaceList(facelist)
663 , myMaterial(material)
705 UT_ASSERT(o &&
"isA<> called with nullptr - use isAValid<>");
706 return X::classof(o);
714 return o && X::classof(o);
723 return static_cast<const X *
>(o);
732 return static_cast<X *
>(o);
741 return isAValid<X>(o) ? static_cast<const X *>(o) :
nullptr;
746 return isA<X>(&o) ? static_cast<const X *>(&o) :
nullptr;
751 return isAValid<X>(o) ? static_cast<X *>(o) :
nullptr;
756 return isA<X>(&o) ? static_cast<X *>(&o) :
nullptr;
776 bool isValid()
const {
return myObject !=
nullptr; }
784 const BRAY_Object *
objectPtr()
const {
return myObject.get(); }
797 void setInstancePrototype(
const ObjectPtr &proto);
800 void setInstanceTransforms(
ScenePtr &scene,
804 void setInstanceAttributes(
const ScenePtr &scene,
811 void setInstanceProperties(
const ScenePtr &scene,
822 bool validateInstance()
const;
840 bool setGeometry(
const ScenePtr &scene,
845 bool setGeometry(
const ScenePtr &scene,
863 void takeOwnership(BRAY_Object *obj);
887 bool isValid()
const {
return myLight !=
nullptr; }
892 const BRAY_Light *
lightPtr()
const {
return myLight.get(); }
906 void setTransform(
const SpacePtr &xforms);
915 void setObjectProperties(
const OptionSet &oprops);
921 void setLightProperties(
const OptionSet &lprops);
924 void commitOptions(
ScenePtr &scene);
927 void updateShaderGraph(
const ScenePtr &scene,
934 void updateFilters(
const ScenePtr &scene,
938 void eraseFilter(
const ScenePtr &scene,
964 bool isValid()
const {
return myInstancer !=
nullptr; }
973 void setInstanceTransforms(
ScenePtr &scene,
977 void setInstanceProperties(
ScenePtr &scene,
1016 bool isValid()
const {
return myCamera !=
nullptr; }
1021 const BRAY_Camera *
cameraPtr()
const {
return myCamera.get(); }
1032 void setShaderMaterial(
const ScenePtr &scene,
1041 void resizeCameraProperties(
int nseg);
1047 void commitOptions(
ScenePtr &scene);
1064 bool isValid()
const {
return mySpace !=
nullptr; }
1070 const BRAY_Camera *
spacePtr()
const {
return mySpace.get(); }
1086 void resizeCameraProperties(
int nseg);
1110 {
return aov.myAOVBuffer == myAOVBuffer; }
1112 {
return !(*
this == aov); }
1117 int getXres()
const;
1118 int getYres()
const;
1121 float getDefaultValue()
const;
1125 bool isMapped()
const;
1128 int getNumExtra()
const;
1132 void *mapExtra(
int idx);
1133 void unmapExtra(
int idx);
1138 bool isConverged()
const;
1139 void setConverged();
1140 void clearConverged();
1143 bool isValid()
const;
1173 template <
typename T>
1177 template <
typename T>
1179 {
return setOption(name, &value, 1); }
1197 , myFilename(filename)
1214 template <
typename T>
1218 template <
typename T>
1220 {
return setOption(name, &value, 1); }
1229 myAOVs.emplace_back(name);
1230 return myAOVs.last();
1236 bool result = doCommit();
1289 void clearOutputPlanes();
1291 int getAOVCount()
const;
1301 bool prepareRender();
1304 void render(
bool (*stopreq)(
void *) =
nullptr,
void *
data =
nullptr);
1307 bool isRendering()
const;
1310 bool isError()
const;
1313 bool isPaused()
const;
1316 void prepareForStop();
1322 bool resumeRender();
1325 void setPriority(
int x,
int y);
1331 void clearPriority();
1336 bool enableImageFilters(
1338 bool is_render_settings_prim);
1341 void setUseRenderSettingsPrim(
bool use_render_settings_prim);
1344 BRAY_Renderer *renderer() {
return myRenderer.get(); }
1367 OptionSet nodeParams(BRAY_ShaderInstance *node);
1391 bool isInt()
const {
return myType == 1; }
1399 return myB.size() + myI.size() + myF.size() + myS.size();
1417 {
return myInputs; }
1419 {
return myOutputs; }
1421 {
return myMetadata; }
1426 { myInputs.append(parm); }
1428 { myOutputs.append(parm); }
1430 { myMetadata = metadata; }
1449 const OptionSet getObjectProperties()
const;
1453 void clearObjectProperties();
void cancel()
Cancel this output file for some reason.
BRAY_EventType
Types of events that can be sent as updates to the renderer.
AOV & appendAOV(const UT_StringHolder &name)
Add an AOV to this output file.
static SYS_FORCE_INLINE bool classof(const InstancablePtr *o)
Test if Instancable is of this type.
UT_StringHolder optionS(BRAY_SceneOption t) const
int64 propertyI(BRAY_SceneOption t) const
GT_API const UT_StringHolder filename
const BRAY_Camera * spacePtr() const
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)
bool isValid() const
Test validity.
float BRAYtime
Consistent representation of time type within BRAY.
getFileOption("OpenEXR:storage") storage
bool operator!=(const AOVBufferPtr &aov) const
InstancablePtr(InstancableType type)
SYS_FORCE_INLINE bool isA(const InstancablePtr *o)
SYS_FORCE_INLINE bool setProperty(BRAY_ObjectProperty token, const T &value)
Simple interface to set a scalar property.
GLsizei const GLchar *const * path
AOV(const UT_StringHolder &name)
UT_SharedPtr< BRAY_Light > myLight
FacesetMaterial(const GT_DataArrayHandle &facelist=GT_DataArrayHandle(), const MaterialPtr &material=MaterialPtr())
const UT_Options & options() const
const UT_StringMap< UT_StringHolder > & metadata() 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)
Class which writes ASCII or binary JSON streams.
int64 optionI(BRAY_SceneOption t) const
**But if you need a result
SYS_FORCE_INLINE bool set(int token, const T &value)
Simple interface to set a scalar property.
const BRAY_Object * objectPtr() const
SYS_FORCE_INLINE exint propertySize(BRAY_ObjectProperty token) const
const UT_Array< Parameter > & inputs() const
const BRAY_Light * lightPtr() const
OutputFile(BRAY::ScenePtr &scene, const UT_StringHolder &filename, const UT_StringHolder &type)
bool isValid() const
Test validity.
CameraPtr(const UT_SharedPtr< BRAY_Camera > &cp=UT_SharedPtr< BRAY_Camera >())
static SYS_FORCE_INLINE bool classof(const InstancablePtr *o)
Test if Instancable is of this type.
IFDmantra you can see code vm_image_mplay_direction endcode When SOHO starts a render
const BRAY_VexMaterial * materialPtr() const
GLintptr GLsizeiptr GLboolean commit
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.
bool isValid() const
Test validity.
SYS_FORCE_INLINE X * dyn_castValid(InstancablePtr &o)
bool propertyB(BRAY_SceneOption t) const
VPRM_OptionSetPtr & options()
const UT_StringHolder name() const
SYS_FORCE_INLINE const X * cast(const InstancablePtr *o)
SYS_FORCE_INLINE GT_Storage propertyStorage(BRAY_ObjectProperty token) const
Return the storage class of an option.
UT_SharedPtr< BRAY_Camera > myCamera
BRAY_RayVisibility
Ray visibility flags.
UT_SharedPtr< BRAY_Object > myObject
UT_Array< UT_StringHolder > myS
BRAY_Camera * cameraPtr()
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
UT_IntrusivePtr< GT_DataArray > GT_DataArrayHandle
SYS_FORCE_INLINE exint optionSize(BRAY_SceneOption token) const
PXL_API const char * getName(const ColorSpace *space)
Return the name of the color space.
void setMetadata(const UT_StringMap< UT_StringHolder > &metadata)
ShaderGraphPtr(UT_SharedPtr< BRAY_ShaderGraph > graph)
static SYS_FORCE_INLINE bool classof(const InstancablePtr *o)
Test if Instancable is of this type.
UT_StringHolder myVariable
NodeDecl(const UT_StringHolder &n)
SYS_FORCE_INLINE bool optionIsVariadic(BRAY_SceneOption token) const
Return whether an option has variadic arguments.
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:
SYS_FORCE_INLINE exint lockAllObjectProperties(bool state)
Lock or unlock all object properties.
const UT_Array< Parameter > & outputs() const
bool isValid() const
Test validity.
Class used to define image planes.
GLuint const GLchar * name
GA_API const UT_StringHolder transform
const UT_Options & options() const
GT_DataArrayHandle myFaceList
SYS_FORCE_INLINE bool isAValid(const InstancablePtr *o)
SYS_FORCE_INLINE bool setOption(BRAY_SceneOption token, const T &value)
Simple interface to set a scalar option.
PXL_DataFormat myDataFormat
A map of string to various well defined value types.
A render product represents an output file.
fpreal64 optionF(BRAY_SceneOption t) const
UT_SharedPtr< LightInstancer > myInstancer
MaterialPtr(BRAY_VexMaterial *mat=nullptr)
LeafData & operator=(const LeafData &)=delete
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result createInstance(const VULKAN_HPP_NAMESPACE::InstanceCreateInfo *pCreateInfo, const VULKAN_HPP_NAMESPACE::AllocationCallbacks *pAllocator, VULKAN_HPP_NAMESPACE::Instance *pInstance, Dispatch const &d) VULKAN_HPP_NOEXCEPT
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)
SYS_FORCE_INLINE bool propertyIsVariadic(BRAY_ObjectProperty token) const
Return whether an property has variadic arguments.
bool isValid() const
Test validity.
**If you just want to fire and args
void addInput(const Parameter &parm)
GLubyte GLubyte GLubyte GLubyte w
bool setOption(const UT_StringHolder &name, const T &value)
MX_GENSHADER_API const TypeDesc * INTEGER
std::shared_ptr< class ShaderMaterial > MaterialPtr
InstancableType instancableType() const
bool optionB(BRAY_SceneOption t) const
Interface to the renderer.
const UT_StringHolder & type() const
fpreal64 propertyF(BRAY_SceneOption t) const
LightInstancerPtr(UT_SharedPtr< LightInstancer > p=nullptr)
SYS_FORCE_INLINE const X * dyn_cast(const InstancablePtr *o)
const VPRM_OptionSetPtr & options() const
BRAY_Object * objectPtr()
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