Skip to content

Commit

Permalink
mmImagePlane2 node - match image plane v1 load parity.
Browse files Browse the repository at this point in the history
It's important we register the geometry overrides, and deregister them,
as well as selection filters.

GitHub issue #252.
  • Loading branch information
david-cattermole committed Jun 16, 2024
1 parent 752fe26 commit 60b1d9e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/mmSolver/nodeTypeIds.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@

#define MM_IMAGE_PLANE_SHAPE_2_TYPE_ID 0x0012F18F
#define MM_IMAGE_PLANE_SHAPE_2_TYPE_NAME "mmImagePlaneShape2"
#define MM_IMAGE_PLANE_SHAPE_2_DRAW_CLASSIFY "drawdb/geometry/mmSolver/imagePlane"
#define MM_IMAGE_PLANE_SHAPE_2_DRAW_CLASSIFY "drawdb/geometry/mmSolver/imagePlane2"
#define MM_IMAGE_PLANE_SHAPE_2_DRAW_REGISTRANT_ID "mmImagePlaneShape2"
#define MM_IMAGE_PLANE_SHAPE_2_SELECTION_TYPE_NAME "mmImagePlaneShape2Selection"
// Same as v1.
Expand Down
21 changes: 19 additions & 2 deletions src/mmSolver/pluginMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,8 @@ MStatus initializePlugin(MObject obj) {
mmsolver::ImagePlaneShape2Node::m_id,
mmsolver::ImagePlaneShape2Node::creator,
mmsolver::ImagePlaneShape2Node::initialize,
MPxNode::kLocatorNode, &imagePlaneShape2Classification,
status);
MPxNode::kLocatorNode,
&imagePlaneShape2Classification, status);
REGISTER_LOCATOR_NODE(
plugin, mmsolver::SkyDomeShapeNode::nodeName(),
mmsolver::SkyDomeShapeNode::m_id, mmsolver::SkyDomeShapeNode::creator,
Expand Down Expand Up @@ -530,6 +530,14 @@ MStatus initializePlugin(MObject obj) {
status = MGlobal::executeCommand(mel_cmd);
CHECK_MSTATUS(status);

MSelectionMask::registerSelectionType(
mmsolver::ImagePlaneShape2Node::m_selection_type_name, 2);
mel_cmd = "selectType -byName \"";
mel_cmd += mmsolver::ImagePlaneShape2Node::m_selection_type_name;
mel_cmd += "\" 1";
status = MGlobal::executeCommand(mel_cmd);
CHECK_MSTATUS(status);

MSelectionMask::registerSelectionType(
mmsolver::SkyDomeShapeNode::m_selection_type_name, 2);
mel_cmd = "selectType -byName \"";
Expand Down Expand Up @@ -561,6 +569,10 @@ MStatus initializePlugin(MObject obj) {
mmsolver::ImagePlaneShapeNode::m_display_filter_name,
mmsolver::ImagePlaneShapeNode::m_display_filter_label,
mmsolver::ImagePlaneShapeNode::m_draw_db_classification);
plugin.registerDisplayFilter(
mmsolver::ImagePlaneShape2Node::m_display_filter_name,
mmsolver::ImagePlaneShape2Node::m_display_filter_label,
mmsolver::ImagePlaneShape2Node::m_draw_db_classification);
plugin.registerDisplayFilter(
mmsolver::SkyDomeShapeNode::m_display_filter_name,
mmsolver::SkyDomeShapeNode::m_display_filter_label,
Expand Down Expand Up @@ -661,6 +673,9 @@ MStatus uninitializePlugin(MObject obj) {
DEREGISTER_GEOMETRY_OVERRIDE(
mmsolver::ImagePlaneShapeNode::m_draw_db_classification,
mmsolver::ImagePlaneShapeNode::m_draw_registrant_id, status);
DEREGISTER_GEOMETRY_OVERRIDE(
mmsolver::ImagePlaneShape2Node::m_draw_db_classification,
mmsolver::ImagePlaneShape2Node::m_draw_registrant_id, status);
DEREGISTER_DRAW_OVERRIDE(
mmsolver::SkyDomeShapeNode::m_draw_db_classification,
mmsolver::SkyDomeShapeNode::m_draw_registrant_id, status);
Expand All @@ -674,6 +689,8 @@ MStatus uninitializePlugin(MObject obj) {
mmsolver::BundleShapeNode::m_id, status);
DEREGISTER_LOCATOR_NODE(plugin, mmsolver::ImagePlaneShapeNode::nodeName(),
mmsolver::ImagePlaneShapeNode::m_id, status);
DEREGISTER_LOCATOR_NODE(plugin, mmsolver::ImagePlaneShape2Node::nodeName(),
mmsolver::ImagePlaneShape2Node::m_id, status);
DEREGISTER_LOCATOR_NODE(plugin, mmsolver::SkyDomeShapeNode::nodeName(),
mmsolver::SkyDomeShapeNode::m_id, status);
DEREGISTER_LOCATOR_NODE(plugin, mmsolver::LineShapeNode::nodeName(),
Expand Down

0 comments on commit 60b1d9e

Please sign in to comment.