diff --git a/docs/source/nodes_display.rst b/docs/source/nodes_display.rst index 31bfd0a5..3c75712a 100644 --- a/docs/source/nodes_display.rst +++ b/docs/source/nodes_display.rst @@ -3,7 +3,12 @@ Display Nodes *To be written.* -``mmRenderGlobals`` Nodes +``mmRenderGlobalsStandard`` Nodes ++++++++++++++++++++++++++ + +*To be written.* + +``mmRenderGlobalsSilhouette`` Nodes +++++++++++++++++++++++++ *To be written.* diff --git a/include/mmSolver/nodeTypeIds.h b/include/mmSolver/nodeTypeIds.h index e3afcd76..b8aa0b0b 100644 --- a/include/mmSolver/nodeTypeIds.h +++ b/include/mmSolver/nodeTypeIds.h @@ -86,9 +86,9 @@ #define MM_MARKER_GROUP_TRANSFORM_TYPE_NAME "mmMarkerGroupTransform" #define MM_MARKER_GROUP_DRAW_CLASSIFY "drawdb/geometry/transform" -#define MM_RENDERER_BASIC_NAME "mmRenderer" -#define MM_RENDER_GLOBALS_BASIC_TYPE_ID 0x0012F194 -#define MM_RENDER_GLOBALS_BASIC_TYPE_NAME "mmRenderGlobals" +#define MM_RENDERER_STANDARD_NAME "mmRendererStandard" +#define MM_RENDER_GLOBALS_STANDARD_TYPE_ID 0x0012F194 +#define MM_RENDER_GLOBALS_STANDARD_TYPE_NAME "mmRenderGlobalsStandard" #define MM_RENDERER_SILHOUETTE_NAME "mmRendererSilhouette" #define MM_RENDER_GLOBALS_SILHOUETTE_TYPE_ID 0x0012F18E diff --git a/mel/AETemplates/AEmmRenderGlobalsSilhouetteTemplate.mel b/mel/AETemplates/AEmmRenderGlobalsSilhouetteTemplate.mel index bd90bf30..1b03b899 100644 --- a/mel/AETemplates/AEmmRenderGlobalsSilhouetteTemplate.mel +++ b/mel/AETemplates/AEmmRenderGlobalsSilhouetteTemplate.mel @@ -17,7 +17,7 @@ // along with mmSolver. If not, see . // --------------------------------------------------------------------- // -// mmRenderer Render Globals AE Template +// Silhouette Renderer Render Globals AE Template // global proc AEmmRenderGlobalsSilhouetteTemplate(string $name) { diff --git a/mel/AETemplates/AEmmRenderGlobalsTemplate.mel b/mel/AETemplates/AEmmRenderGlobalsStandardTemplate.mel similarity index 92% rename from mel/AETemplates/AEmmRenderGlobalsTemplate.mel rename to mel/AETemplates/AEmmRenderGlobalsStandardTemplate.mel index 04776493..29c6021f 100644 --- a/mel/AETemplates/AEmmRenderGlobalsTemplate.mel +++ b/mel/AETemplates/AEmmRenderGlobalsStandardTemplate.mel @@ -17,10 +17,10 @@ // along with mmSolver. If not, see . // --------------------------------------------------------------------- // -// mmRenderer Render Globals AE Template +// Standard Renderer Render Globals AE Template // -global proc AEmmRenderGlobalsTemplate(string $name) { +global proc AEmmRenderGlobalsStandardTemplate(string $name) { string $parent = `setParent -q`; editorTemplate -beginScrollLayout; diff --git a/mel/mmRendererSilhouetteOptionBox.mel b/mel/mmRendererSilhouetteOptionBox.mel index 0f4aa48d..42c884b7 100644 --- a/mel/mmRendererSilhouetteOptionBox.mel +++ b/mel/mmRendererSilhouetteOptionBox.mel @@ -32,14 +32,15 @@ // global proc mmRendererSilhouetteOptionBox() { - print("mmRendererSilhouetteOptionBox"); - if (!`objExists "mmRenderGlobalsSilhouette"`) { - string $node = `createNode "mmRenderGlobalsSilhouette" - -name "mmRenderGlobalsSilhouette" + // print("mmRendererSilhouetteOptionBox"); + string $node_type = "mmRenderGlobalsSilhouette"; + if (!`objExists $node_type`) { + string $node = `createNode $node_type + -name $node_type -shared -skipSelect`; lockNode -lock on $node; } - select -r "mmRenderGlobalsSilhouette"; + select -r $node_type; // Users want to be able to select and change the color swatch, so // we need the attribute editor open. diff --git a/mel/mmRendererOptionBox.mel b/mel/mmRendererStandardOptionBox.mel similarity index 83% rename from mel/mmRendererOptionBox.mel rename to mel/mmRendererStandardOptionBox.mel index 7290d35b..4473ec2d 100644 --- a/mel/mmRendererOptionBox.mel +++ b/mel/mmRendererStandardOptionBox.mel @@ -31,14 +31,15 @@ // // -global proc mmRendererOptionBox() { - print("mmRendererOptionBox"); - if (!`objExists "mmRenderGlobals"`) { - string $node = `createNode "mmRenderGlobals" - -name "mmRenderGlobals" +global proc mmRendererStandardOptionBox() { + // print("mmRendererStandardOptionBox"); + string $node_type = "mmRenderGlobalsStandard"; + if (!`objExists $node_type`) { + string $node = `createNode $node_type + -name $node_type -shared -skipSelect`; lockNode -lock on $node; } - select -r "mmRenderGlobals"; + select -r $node_type; return; } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 740276e7..5603c7bc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -130,10 +130,10 @@ set(SOURCE_FILES if (MMSOLVER_BUILD_RENDERER) set(SOURCE_FILES ${SOURCE_FILES} - mmSolver/render/MMRendererBasicCmd.cpp + mmSolver/render/MMRendererStandardCmd.cpp mmSolver/render/MMRendererSilhouetteCmd.cpp - mmSolver/render/RenderOverrideBasic.cpp - mmSolver/render/RenderGlobalsBasicNode.cpp + mmSolver/render/RenderOverrideStandard.cpp + mmSolver/render/RenderGlobalsStandardNode.cpp mmSolver/render/RenderGlobalsSilhouetteNode.cpp mmSolver/render/RenderOverrideSilhouette.cpp mmSolver/render/ops/ClearOperation.cpp diff --git a/src/mmSolver/pluginMain.cpp b/src/mmSolver/pluginMain.cpp index 157662ef..fbe0c62d 100644 --- a/src/mmSolver/pluginMain.cpp +++ b/src/mmSolver/pluginMain.cpp @@ -85,12 +85,12 @@ // MM Renderer #if MMSOLVER_BUILD_RENDERER == 1 -#include "mmSolver/render/MMRendererBasicCmd.h" #include "mmSolver/render/MMRendererSilhouetteCmd.h" -#include "mmSolver/render/RenderGlobalsBasicNode.h" +#include "mmSolver/render/MMRendererStandardCmd.h" #include "mmSolver/render/RenderGlobalsSilhouetteNode.h" -#include "mmSolver/render/RenderOverrideBasic.h" +#include "mmSolver/render/RenderGlobalsStandardNode.h" #include "mmSolver/render/RenderOverrideSilhouette.h" +#include "mmSolver/render/RenderOverrideStandard.h" #endif #define REGISTER_COMMAND(plugin, name, creator, syntax, stat) \ @@ -436,18 +436,20 @@ MStatus initializePlugin(MObject obj) { markerTfmClassification, status); #if MMSOLVER_BUILD_RENDERER == 1 - REGISTER_COMMAND(plugin, mmsolver::render::MMRendererBasicCmd::cmdName(), - mmsolver::render::MMRendererBasicCmd::creator, - mmsolver::render::MMRendererBasicCmd::newSyntax, status); + REGISTER_COMMAND(plugin, mmsolver::render::MMRendererStandardCmd::cmdName(), + mmsolver::render::MMRendererStandardCmd::creator, + mmsolver::render::MMRendererStandardCmd::newSyntax, + status); REGISTER_COMMAND( plugin, mmsolver::render::MMRendererSilhouetteCmd::cmdName(), mmsolver::render::MMRendererSilhouetteCmd::creator, mmsolver::render::MMRendererSilhouetteCmd::newSyntax, status); - REGISTER_NODE(plugin, mmsolver::render::RenderGlobalsBasicNode::nodeName(), - mmsolver::render::RenderGlobalsBasicNode::m_id, - mmsolver::render::RenderGlobalsBasicNode::creator, - mmsolver::render::RenderGlobalsBasicNode::initialize, status); + REGISTER_NODE( + plugin, mmsolver::render::RenderGlobalsStandardNode::nodeName(), + mmsolver::render::RenderGlobalsStandardNode::m_id, + mmsolver::render::RenderGlobalsStandardNode::creator, + mmsolver::render::RenderGlobalsStandardNode::initialize, status); REGISTER_NODE( plugin, mmsolver::render::RenderGlobalsSilhouetteNode::nodeName(), mmsolver::render::RenderGlobalsSilhouetteNode::m_id, @@ -486,9 +488,9 @@ MStatus initializePlugin(MObject obj) { shader_location += MString("/shader"); shader_manager->addShaderPath(shader_location); - mmsolver::render::RenderOverrideBasic* default_renderer_ptr = - new mmsolver::render::RenderOverrideBasic( - MM_RENDERER_BASIC_NAME); + mmsolver::render::RenderOverrideStandard* default_renderer_ptr = + new mmsolver::render::RenderOverrideStandard( + MM_RENDERER_STANDARD_NAME); renderer->registerOverride(default_renderer_ptr); mmsolver::render::RenderOverrideSilhouette* @@ -619,7 +621,7 @@ MStatus uninitializePlugin(MObject obj) { if (renderer) { // Find override with the given name and deregister const MHWRender::MRenderOverride* default_renderer_ptr = - renderer->findRenderOverride(MM_RENDERER_BASIC_NAME); + renderer->findRenderOverride(MM_RENDERER_STANDARD_NAME); if (default_renderer_ptr) { renderer->deregisterOverride(default_renderer_ptr); delete default_renderer_ptr; @@ -633,14 +635,14 @@ MStatus uninitializePlugin(MObject obj) { } } - DEREGISTER_COMMAND(plugin, mmsolver::render::MMRendererBasicCmd::cmdName(), - status); + DEREGISTER_COMMAND( + plugin, mmsolver::render::MMRendererStandardCmd::cmdName(), status); DEREGISTER_COMMAND( plugin, mmsolver::render::MMRendererSilhouetteCmd::cmdName(), status); DEREGISTER_NODE(plugin, - mmsolver::render::RenderGlobalsBasicNode::nodeName(), - mmsolver::render::RenderGlobalsBasicNode::m_id, status); + mmsolver::render::RenderGlobalsStandardNode::nodeName(), + mmsolver::render::RenderGlobalsStandardNode::m_id, status); DEREGISTER_NODE( plugin, mmsolver::render::RenderGlobalsSilhouetteNode::nodeName(), mmsolver::render::RenderGlobalsSilhouetteNode::m_id, status); diff --git a/src/mmSolver/render/MMRendererBasicCmd.cpp b/src/mmSolver/render/MMRendererStandardCmd.cpp similarity index 73% rename from src/mmSolver/render/MMRendererBasicCmd.cpp rename to src/mmSolver/render/MMRendererStandardCmd.cpp index 86688b56..d6868c1b 100644 --- a/src/mmSolver/render/MMRendererBasicCmd.cpp +++ b/src/mmSolver/render/MMRendererStandardCmd.cpp @@ -19,7 +19,7 @@ * */ -#include "MMRendererBasicCmd.h" +#include "MMRendererStandardCmd.h" // Maya #include @@ -29,26 +29,28 @@ #include // MM Solver -#include "RenderOverrideBasic.h" +#include "RenderOverrideStandard.h" namespace mmsolver { namespace render { -MMRendererBasicCmd::MMRendererBasicCmd() {} +MMRendererStandardCmd::MMRendererStandardCmd() {} -MMRendererBasicCmd::~MMRendererBasicCmd() {} +MMRendererStandardCmd::~MMRendererStandardCmd() {} -void *MMRendererBasicCmd::creator() { return (void *)(new MMRendererBasicCmd); } +void *MMRendererStandardCmd::creator() { + return (void *)(new MMRendererStandardCmd); +} -MString MMRendererBasicCmd::cmdName() { return kRendererBasicCmdName; } +MString MMRendererStandardCmd::cmdName() { return kRendererStandardCmdName; } -MSyntax MMRendererBasicCmd::newSyntax() { +MSyntax MMRendererStandardCmd::newSyntax() { MSyntax syntax; syntax.enableQuery(true); return syntax; } -MStatus MMRendererBasicCmd::doIt(const MArgList &args) { +MStatus MMRendererStandardCmd::doIt(const MArgList &args) { MStatus status = MStatus::kFailure; MHWRender::MRenderer *renderer = MHWRender::MRenderer::theRenderer(); @@ -57,10 +59,11 @@ MStatus MMRendererBasicCmd::doIt(const MArgList &args) { return status; } - RenderOverrideBasic *override_ptr = - (RenderOverrideBasic *)renderer->findRenderOverride(kRendererBasicName); + RenderOverrideStandard *override_ptr = + (RenderOverrideStandard *)renderer->findRenderOverride( + kRendererStandardName); if (override_ptr == nullptr) { - MGlobal::displayError(kRendererBasicCmdName + " is not registered."); + MGlobal::displayError(kRendererStandardCmdName + " is not registered."); return status; } diff --git a/src/mmSolver/render/MMRendererBasicCmd.h b/src/mmSolver/render/MMRendererStandardCmd.h similarity index 74% rename from src/mmSolver/render/MMRendererBasicCmd.h rename to src/mmSolver/render/MMRendererStandardCmd.h index 92401ab1..1ff06bb4 100644 --- a/src/mmSolver/render/MMRendererBasicCmd.h +++ b/src/mmSolver/render/MMRendererStandardCmd.h @@ -17,17 +17,17 @@ * along with mmSolver. If not, see . * ==================================================================== * - * mmSolver Basic Renderer command. + * mmSolver Standard Renderer command. * * This command is used to query and edit values for the mmSolver * Renderer. * - * Create a 'mmRendererBasic' node used to store the attributes for the + * Create a 'mmRendererStandard' node used to store the attributes for the * renderer in the scene. */ -#ifndef MM_SOLVER_RENDER_MM_RENDERER_BASIC_CMD_H -#define MM_SOLVER_RENDER_MM_RENDERER_BASIC_CMD_H +#ifndef MM_SOLVER_RENDER_MM_RENDERER_STANDARD_CMD_H +#define MM_SOLVER_RENDER_MM_RENDERER_STANDARD_CMD_H // Maya #include @@ -36,13 +36,13 @@ namespace mmsolver { namespace render { /* - * MM Basic Renderer command. + * MM Standard Renderer command. */ -class MMRendererBasicCmd : public MPxCommand { +class MMRendererStandardCmd : public MPxCommand { public: - MMRendererBasicCmd(); + MMRendererStandardCmd(); - ~MMRendererBasicCmd() override; + ~MMRendererStandardCmd() override; MStatus doIt(const MArgList &args) override; @@ -56,4 +56,4 @@ class MMRendererBasicCmd : public MPxCommand { } // namespace render } // namespace mmsolver -#endif // MAYA_MM_SOLVER_RENDER_MM_RENDERER_BASIC_CMD_H +#endif // MAYA_MM_SOLVER_RENDER_MM_RENDERER_STANDARD_CMD_H diff --git a/src/mmSolver/render/RenderGlobalsBasicNode.cpp b/src/mmSolver/render/RenderGlobalsStandardNode.cpp similarity index 74% rename from src/mmSolver/render/RenderGlobalsBasicNode.cpp rename to src/mmSolver/render/RenderGlobalsStandardNode.cpp index b2456aa9..a97a3c67 100644 --- a/src/mmSolver/render/RenderGlobalsBasicNode.cpp +++ b/src/mmSolver/render/RenderGlobalsStandardNode.cpp @@ -20,7 +20,7 @@ * Stores global values for the mmSolver viewport renderer. */ -#include "RenderGlobalsBasicNode.h" +#include "RenderGlobalsStandardNode.h" // Maya #include @@ -37,7 +37,7 @@ #include // MM Solver -#include "RenderOverrideBasic.h" +#include "RenderOverrideStandard.h" #include "mmSolver/nodeTypeIds.h" #include "mmSolver/render/data/RenderColorFormat.h" #include "mmSolver/utilities/debug_utils.h" @@ -45,21 +45,22 @@ namespace mmsolver { namespace render { -MTypeId RenderGlobalsBasicNode::m_id(MM_RENDER_GLOBALS_BASIC_TYPE_ID); +MTypeId RenderGlobalsStandardNode::m_id(MM_RENDER_GLOBALS_STANDARD_TYPE_ID); -RenderGlobalsBasicNode::RenderGlobalsBasicNode() : m_attr_change_callback(0) {} +RenderGlobalsStandardNode::RenderGlobalsStandardNode() + : m_attr_change_callback(0) {} -RenderGlobalsBasicNode::~RenderGlobalsBasicNode() { +RenderGlobalsStandardNode::~RenderGlobalsStandardNode() { if (m_attr_change_callback) { MMessage::removeCallback(m_attr_change_callback); } } -MString RenderGlobalsBasicNode::nodeName() { - return MString(MM_RENDER_GLOBALS_BASIC_TYPE_NAME); +MString RenderGlobalsStandardNode::nodeName() { + return MString(MM_RENDER_GLOBALS_STANDARD_TYPE_NAME); } -void RenderGlobalsBasicNode::postConstructor() { +void RenderGlobalsStandardNode::postConstructor() { MObject obj = thisMObject(); if ((m_attr_change_callback == 0) && (!obj.isNull())) { m_attr_change_callback = @@ -67,7 +68,7 @@ void RenderGlobalsBasicNode::postConstructor() { } } -void RenderGlobalsBasicNode::attr_change_func( +void RenderGlobalsStandardNode::attr_change_func( MNodeMessage::AttributeMessage msg, MPlug &plug, MPlug & /*other_plug*/, void * /*client_data*/) { const bool verbose = false; @@ -95,11 +96,11 @@ void RenderGlobalsBasicNode::attr_change_func( return; } - RenderOverrideBasic *override_ptr = - (RenderOverrideBasic *)renderer->findRenderOverride( - MM_RENDERER_BASIC_NAME); + RenderOverrideStandard *override_ptr = + (RenderOverrideStandard *)renderer->findRenderOverride( + MM_RENDERER_STANDARD_NAME); if (override_ptr == nullptr) { - MGlobal::displayError(kRendererBasicCmdName + " is not registered."); + MGlobal::displayError(kRendererStandardCmdName + " is not registered."); return; } @@ -112,17 +113,17 @@ void RenderGlobalsBasicNode::attr_change_func( view.refresh(/*all=*/false, /*force=*/true); } -MStatus RenderGlobalsBasicNode::compute(const MPlug & /*plug*/, - MDataBlock & /*data*/) { +MStatus RenderGlobalsStandardNode::compute(const MPlug & /*plug*/, + MDataBlock & /*data*/) { // This node does not compute any values. return MS::kUnknownParameter; } -void *RenderGlobalsBasicNode::creator() { - return (new RenderGlobalsBasicNode()); +void *RenderGlobalsStandardNode::creator() { + return (new RenderGlobalsStandardNode()); } -MStatus RenderGlobalsBasicNode::initialize() { return MS::kSuccess; } +MStatus RenderGlobalsStandardNode::initialize() { return MS::kSuccess; } } // namespace render } // namespace mmsolver diff --git a/src/mmSolver/render/RenderGlobalsBasicNode.h b/src/mmSolver/render/RenderGlobalsStandardNode.h similarity index 85% rename from src/mmSolver/render/RenderGlobalsBasicNode.h rename to src/mmSolver/render/RenderGlobalsStandardNode.h index 0057876e..099ad01b 100644 --- a/src/mmSolver/render/RenderGlobalsBasicNode.h +++ b/src/mmSolver/render/RenderGlobalsStandardNode.h @@ -20,8 +20,8 @@ * Stores global values for the mmSolver viewport renderer. */ -#ifndef MM_SOLVER_RENDER_RENDER_GLOBALS_BASIC_NODE_H -#define MM_SOLVER_RENDER_RENDER_GLOBALS_BASIC_NODE_H +#ifndef MM_SOLVER_RENDER_RENDER_GLOBALS_STANDARD_NODE_H +#define MM_SOLVER_RENDER_RENDER_GLOBALS_STANDARD_NODE_H // Maya #include @@ -34,11 +34,11 @@ namespace mmsolver { namespace render { -class RenderGlobalsBasicNode : public MPxNode { +class RenderGlobalsStandardNode : public MPxNode { public: - RenderGlobalsBasicNode(); + RenderGlobalsStandardNode(); - ~RenderGlobalsBasicNode() override; + ~RenderGlobalsStandardNode() override; MStatus compute(const MPlug &plug, MDataBlock &data) override; @@ -63,4 +63,4 @@ class RenderGlobalsBasicNode : public MPxNode { } // namespace render } // namespace mmsolver -#endif // MM_SOLVER_RENDER_RENDER_GLOBALS_BASIC_NODE_H +#endif // MM_SOLVER_RENDER_RENDER_GLOBALS_STANDARD_NODE_H diff --git a/src/mmSolver/render/RenderOverrideSilhouette.h b/src/mmSolver/render/RenderOverrideSilhouette.h index 5a7c9bf7..e79b32c1 100644 --- a/src/mmSolver/render/RenderOverrideSilhouette.h +++ b/src/mmSolver/render/RenderOverrideSilhouette.h @@ -39,7 +39,7 @@ #include // MM Solver -#include "RenderGlobalsBasicNode.h" +#include "RenderGlobalsStandardNode.h" #include "mmSolver/render/data/RenderMode.h" #include "mmSolver/render/data/constants.h" #include "mmSolver/render/ops/ClearOperation.h" @@ -107,7 +107,7 @@ class RenderOverrideSilhouette : public MHWRender::MRenderOverride { HudRender* m_hudOp; PresentTarget* m_presentOp; - // A handle to the 'mmRenderGlobals' node. + // A handle to the 'mmRenderGlobalsSilhouette' node. MObjectHandle m_globals_node; MSelectionList m_image_plane_nodes; diff --git a/src/mmSolver/render/RenderOverrideBasic.cpp b/src/mmSolver/render/RenderOverrideStandard.cpp similarity index 82% rename from src/mmSolver/render/RenderOverrideBasic.cpp rename to src/mmSolver/render/RenderOverrideStandard.cpp index 5ff36861..afecf6de 100644 --- a/src/mmSolver/render/RenderOverrideBasic.cpp +++ b/src/mmSolver/render/RenderOverrideStandard.cpp @@ -21,7 +21,7 @@ * */ -#include "RenderOverrideBasic.h" +#include "RenderOverrideStandard.h" // Maya #include @@ -49,30 +49,30 @@ namespace mmsolver { namespace render { static MStatus create_render_globals_node() { - return MGlobal::executeCommand(kRendererBasicCreateNodeCommand, + return MGlobal::executeCommand(kRendererStandardCreateNodeCommand, /*displayEnabled*/ true, /*undoEnabled*/ true); } // Callback for tracking renderer changes -void RenderOverrideBasic::renderer_change_func(const MString &panel_name, - const MString &old_renderer, - const MString &new_renderer, - void * /*client_data*/) { +void RenderOverrideStandard::renderer_change_func(const MString &panel_name, + const MString &old_renderer, + const MString &new_renderer, + void * /*client_data*/) { const bool verbose = false; MMSOLVER_MAYA_VRB("Renderer changed for panel '" << panel_name.asChar() << "'. " << "New renderer is '" << new_renderer.asChar() << "', " << "old was '" << old_renderer.asChar() << "'."); - if (new_renderer == MM_RENDERER_BASIC_NAME) { + if (new_renderer == MM_RENDERER_STANDARD_NAME) { MStatus status = create_render_globals_node(); CHECK_MSTATUS(status); } } // Callback for tracking render override changes -void RenderOverrideBasic::render_override_change_func( +void RenderOverrideStandard::render_override_change_func( const MString &panel_name, const MString &old_renderer, const MString &new_renderer, void * /*client_data*/) { const bool verbose = false; @@ -81,27 +81,28 @@ void RenderOverrideBasic::render_override_change_func( << "New override is '" << new_renderer.asChar() << "', " << "old was '" << old_renderer.asChar() << "'."); - if (new_renderer == MM_RENDERER_BASIC_NAME) { + if (new_renderer == MM_RENDERER_STANDARD_NAME) { MStatus status = create_render_globals_node(); CHECK_MSTATUS(status); } } // Set up operations -RenderOverrideBasic::RenderOverrideBasic(const MString &name) +RenderOverrideStandard::RenderOverrideStandard(const MString &name) : MRenderOverride(name) - , m_ui_name(kRendererBasicUiName) + , m_ui_name(kRendererStandardUiName) , m_renderer_change_callback(0) , m_render_override_change_callback(0) , m_globals_node() { MHWRender::MRenderer *renderer = MHWRender::MRenderer::theRenderer(); if (!renderer) { MMSOLVER_MAYA_ERR( - "MM Renderer Basic Render Override: " + "MM Renderer Standard Render Override: " "Failed to get renderer."); } - const MString kBackgroundOpName = MString("mmRendererBasic_backgroundPass"); + const MString kBackgroundOpName = + MString("mmRendererStandard_backgroundPass"); m_backgroundOp = new SceneRender(kBackgroundOpName); m_backgroundOp->setEnabled(true); @@ -143,10 +144,10 @@ RenderOverrideBasic::RenderOverrideBasic(const MString &name) MHWRender::MRenderOperation::kStandardBackgroundName, m_backgroundOp); } -RenderOverrideBasic::~RenderOverrideBasic() { +RenderOverrideStandard::~RenderOverrideStandard() { m_backgroundOp = nullptr; - RenderOverrideBasic::cleanup(); + RenderOverrideStandard::cleanup(); // Clean up callbacks if (m_renderer_change_callback) { @@ -157,16 +158,16 @@ RenderOverrideBasic::~RenderOverrideBasic() { } } -MHWRender::DrawAPI RenderOverrideBasic::supportedDrawAPIs() const { +MHWRender::DrawAPI RenderOverrideStandard::supportedDrawAPIs() const { // The SilhouetteRender only works on OpenGL, so we cannot support // DirectX on Windows or Metal on Apple. return MHWRender::kOpenGLCoreProfile; } // Perform any setup required before render operations are to be executed. -MStatus RenderOverrideBasic::setup(const MString &destination) { +MStatus RenderOverrideStandard::setup(const MString &destination) { const bool verbose = false; - MMSOLVER_MAYA_VRB("RenderOverrideBasic::setup: start " + MMSOLVER_MAYA_VRB("RenderOverrideStandard::setup: start " << destination.asChar()); MStatus status = MS::kSuccess; @@ -187,19 +188,19 @@ MStatus RenderOverrideBasic::setup(const MString &destination) { } MMSOLVER_MAYA_VRB( - "RenderOverrideBasic::setup: m_backgroundOp=" << m_backgroundOp); + "RenderOverrideStandard::setup: m_backgroundOp=" << m_backgroundOp); if (m_backgroundOp) { m_image_plane_nodes.clear(); status = add_all_image_planes(m_image_plane_nodes); MMSOLVER_MAYA_VRB( - "RenderOverrideBasic::setup: m_image_plane_nodes.length()=" + "RenderOverrideStandard::setup: m_image_plane_nodes.length()=" << m_image_plane_nodes.length()); CHECK_MSTATUS_AND_RETURN_IT(status); m_backgroundOp->setObjectSetOverride(&m_image_plane_nodes); } - MMSOLVER_MAYA_VRB("RenderOverrideBasic::setup: end " + MMSOLVER_MAYA_VRB("RenderOverrideStandard::setup: end " << destination.asChar()); return MRenderOverride::setup(destination); } @@ -209,9 +210,9 @@ MStatus RenderOverrideBasic::setup(const MString &destination) { // // End of frame cleanup. Clears out any data on operations which may // change from frame to frame (render target, output panel name etc). -MStatus RenderOverrideBasic::cleanup() { +MStatus RenderOverrideStandard::cleanup() { const bool verbose = false; - MMSOLVER_MAYA_VRB("RenderOverrideBasic::cleanup: "); + MMSOLVER_MAYA_VRB("RenderOverrideStandard::cleanup: "); return MRenderOverride::cleanup(); } diff --git a/src/mmSolver/render/RenderOverrideBasic.h b/src/mmSolver/render/RenderOverrideStandard.h similarity index 86% rename from src/mmSolver/render/RenderOverrideBasic.h rename to src/mmSolver/render/RenderOverrideStandard.h index 081d5ccb..dac16f4b 100644 --- a/src/mmSolver/render/RenderOverrideBasic.h +++ b/src/mmSolver/render/RenderOverrideStandard.h @@ -21,8 +21,8 @@ * */ -#ifndef MM_SOLVER_RENDER_BASIC_RENDER_OVERRIDE_H -#define MM_SOLVER_RENDER_BASIC_RENDER_OVERRIDE_H +#ifndef MM_SOLVER_RENDER_STANDARD_RENDER_OVERRIDE_H +#define MM_SOLVER_RENDER_STANDARD_RENDER_OVERRIDE_H // STL #include @@ -37,7 +37,7 @@ #include // MM Solver -#include "RenderGlobalsBasicNode.h" +#include "RenderGlobalsStandardNode.h" #include "mmSolver/render/data/RenderMode.h" #include "mmSolver/render/data/constants.h" #include "mmSolver/render/ops/SceneRender.h" @@ -46,10 +46,10 @@ namespace mmsolver { namespace render { -class RenderOverrideBasic : public MHWRender::MRenderOverride { +class RenderOverrideStandard : public MHWRender::MRenderOverride { public: - RenderOverrideBasic(const MString& name); - ~RenderOverrideBasic() override; + RenderOverrideStandard(const MString& name); + ~RenderOverrideStandard() override; MHWRender::DrawAPI supportedDrawAPIs() const override; @@ -81,7 +81,7 @@ class RenderOverrideBasic : public MHWRender::MRenderOverride { private: SceneRender* m_backgroundOp; - // A handle to the 'mmRenderGlobals' node. + // A handle to the 'mmRenderGlobalsStandard' node. MObjectHandle m_globals_node; MSelectionList m_image_plane_nodes; @@ -90,4 +90,4 @@ class RenderOverrideBasic : public MHWRender::MRenderOverride { } // namespace render } // namespace mmsolver -#endif // MAYA_MM_SOLVER_RENDER_BASIC_RENDER_OVERRIDE_H +#endif // MAYA_MM_SOLVER_RENDER_STANDARD_RENDER_OVERRIDE_H diff --git a/src/mmSolver/render/data/constants.h b/src/mmSolver/render/data/constants.h index 94bdb887..05a54b03 100644 --- a/src/mmSolver/render/data/constants.h +++ b/src/mmSolver/render/data/constants.h @@ -92,23 +92,23 @@ const BackgroundStyle kBackgroundStyleDefault = BackgroundStyle::kMayaDefault; const RenderColorFormat kRenderColorFormatDefault = RenderColorFormat::kRGBA16BitFloat; -// Basic Constants -const MString kRenderGlobalsBasicNodeName = "mmRenderGlobals"; -const MString kRendererBasicCmdName = "mmRenderer"; -const char kRendererBasicName[] = "mmRenderer"; -const char kRendererBasicUiName[] = "mmRenderer"; -const MString kRendererBasicCreateNodeCommand = +// Standard Renderer Constants +const MString kRenderGlobalsStandardNodeName = "mmRenderGlobalsStandard"; +const MString kRendererStandardCmdName = "mmRendererStandard"; +const char kRendererStandardName[] = "mmRendererStandard"; +const char kRendererStandardUiName[] = "MM Standard Renderer"; +const MString kRendererStandardCreateNodeCommand = "string $mm_globals_node = `createNode \"" + - MString(MM_RENDER_GLOBALS_BASIC_TYPE_NAME) + "\" -name \"" + - MString(kRenderGlobalsBasicNodeName) + "\" -shared -skipSelect`;\n" + + MString(MM_RENDER_GLOBALS_STANDARD_TYPE_NAME) + "\" -name \"" + + MString(kRenderGlobalsStandardNodeName) + "\" -shared -skipSelect`;\n" + "if (size($mm_globals_node) > 0) {\n" + " lockNode -lock on $mm_globals_node;\n" + "}\n"; -// Silhouette Constants +// Silhouette Renderer Constants const MString kRenderGlobalsSilhouetteNodeName = "mmRenderGlobalsSilhouette"; const MString kRendererSilhouetteCmdName = "mmRendererSilhouette"; const char kRendererSilhouetteName[] = "mmRendererSilhouette"; -const char kRendererSilhouetteUiName[] = "mmRenderer (silhouette)"; +const char kRendererSilhouetteUiName[] = "MM Silhouette Renderer"; const MString kRendererSilhouetteCreateNodeCommand = "string $mm_globals_node = `createNode \"" + MString(MM_RENDER_GLOBALS_SILHOUETTE_TYPE_NAME) + "\" -name \"" +