AL_USDMaya  0.16.6
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ProxyDrawOverride.h
1 #pragma once
2 #include "AL/usdmaya/Common.h"
3 #include "maya/MPxDrawOverride.h"
4 
5 #include "pxr/usdImaging/usdImaging/version.h"
6 #if (USD_IMAGING_API_VERSION >= 7)
7 # include "pxr/usdImaging/usdImagingGL/hdEngine.h"
8 #else
9 # include "pxr/usdImaging/usdImaging/hdEngine.h"
10 #endif
11 
12 namespace AL {
13 namespace usdmaya {
14 namespace nodes {
15 
16 //----------------------------------------------------------------------------------------------------------------------
19 //----------------------------------------------------------------------------------------------------------------------
21  : public MHWRender::MPxDrawOverride
22 {
23 public:
24 
27  ProxyDrawOverride(const MObject& obj);
28 
31 
35  static MHWRender::MPxDrawOverride* creator(const MObject& obj);
36 
41  bool isBounded(
42  const MDagPath& objPath,
43  const MDagPath& cameraPath) const override;
44 
49  MBoundingBox boundingBox(
50  const MDagPath& objPath,
51  const MDagPath& cameraPath) const override;
52 
59  MUserData* prepareForDraw(
60  const MDagPath& objPath,
61  const MDagPath& cameraPath,
62  const MHWRender::MFrameContext& frameContext,
63  MUserData* oldData) override;
64 
66  static MString kDrawDbClassification;
67 
69  static MString kDrawRegistrantId;
70 
74  static void draw(const MHWRender::MDrawContext& context, const MUserData* data);
75 
79  static ProxyShape* getShape(const MDagPath& objPath);
80 
83  MHWRender::DrawAPI supportedDrawAPIs() const override
84  {
85  return MHWRender::kOpenGL | MHWRender::kOpenGLCoreProfile;
86  }
87 };
88 
89 //----------------------------------------------------------------------------------------------------------------------
90 } // nodes
91 } // usdmaya
92 } // AL
93 //----------------------------------------------------------------------------------------------------------------------
static MString kDrawRegistrantId
draw registration id for this override
Definition: ProxyDrawOverride.h:69
A custom proxy shape node that attaches itself to a USD file, and then renders it. The stage is held internally as a member variable, and it will be composed based on a change to the "filePath" attribute.
Definition: ProxyShape.h:33
MBoundingBox boundingBox(const MDagPath &objPath, const MDagPath &cameraPath) const override
Called by Maya whenever the bounding box of the drawable object is needed.
static ProxyShape * getShape(const MDagPath &objPath)
utility function to get a pointer to the proxy shape node given the specified path ...
static MString kDrawDbClassification
draw classification string for this override
Definition: ProxyDrawOverride.h:66
MUserData * prepareForDraw(const MDagPath &objPath, const MDagPath &cameraPath, const MHWRender::MFrameContext &frameContext, MUserData *oldData) override
Called by Maya whenever the object is dirty and needs to update for draw.
This class provides the draw override for the USD proxy shape node.
Definition: ProxyDrawOverride.h:20
MHWRender::DrawAPI supportedDrawAPIs() const override
We support the legacy and VP2 core profile rendering.
Definition: ProxyDrawOverride.h:83
bool isBounded(const MDagPath &objPath, const MDagPath &cameraPath) const override
Called by Maya to determine if the drawable object is bounded or not.
static MHWRender::MPxDrawOverride * creator(const MObject &obj)
static creator method
ProxyDrawOverride(const MObject &obj)
ctor
static void draw(const MHWRender::MDrawContext &context, const MUserData *data)
The draw callback, performs the actual rendering for the draw override.