Atom viewport render option bugfix (#7158)

* Render option bugfix

Signed-off-by: rhhong <rhhong@amazon.com>

* add aznumeric_cast

Signed-off-by: rhhong <rhhong@amazon.com>
monroegm-disable-blank-issue-2
Roman 4 years ago committed by GitHub
parent 75d39d9ce5
commit e2c4c0e5e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="background: #A675FF;">
<title>Icons / Actor / Cloth / On-2</title>
<g id="Icons-/-Actor-/-Cloth-/-On-2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<rect fill="#A675FF" x="0" y="0" width="24" height="24"></rect>
<rect id="Icon-Background" x="0" y="0" width="24" height="24"></rect>
<path d="M16.9852149,4 L16.9900183,3.9950022 L16.9951083,4 L22,8.91421356 L19.4142136,11.5 L17,9.08578644 L17,20 L7,20 L7,9.08578644 L4.58578644,11.5 L2,8.91421356 L6.99472957,3.99407993 L7.0004522,4 L9.55000906,4 C9.51721513,4.16155497 9.5,4.32876708 9.5,4.5 C9.5,5.88071187 10.6192881,7 12,7 C13.3807119,7 14.5,5.88071187 14.5,4.5 C14.5,4.32876708 14.4827849,4.16155497 14.4499909,4 L16.9852149,4 Z" id="Combined-Shape" fill="#FFFFFF" fill-rule="nonzero"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1005 B

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Icons / Actor / Hit Detection / On-2</title>
<g id="Icons-/-Actor-/-Hit-Detection-/-On-2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<rect id="Icon-Background" fill="#4A90E2" x="0" y="0" width="24" height="24"></rect>
<path d="M8,12 L11,16 L8,20 L8,18.5 L2,18.5 L2,13.5 L8,13.5 L8,12 Z" id="Combined-Shape" fill="#FFFFFF"></path>
<path d="M19,12 L22,16 L19,20 L19,18.5 L13,18.5 L13,13.5 L19,13.5 L19,12 Z" id="Combined-Shape" fill="#FFFFFF" transform="translate(17.500000, 16.000000) scale(-1, 1) translate(-17.500000, -16.000000) "></path>
<rect id="Rectangle-29" fill="#FFFFFF" x="11" y="4" width="2" height="8"></rect>
<polygon id="Rectangle-29" fill="#FFFFFF" transform="translate(17.045050, 7.995390) rotate(45.000000) translate(-17.045050, -7.995390) " points="16.1938033 4.4949714 17.8081016 4.51420795 17.8962973 11.4958096 16.1938033 11.450495"></polygon>
<polygon id="Rectangle-29" fill="#FFFFFF" transform="translate(7.108926, 7.934776) scale(-1, 1) rotate(45.000000) translate(-7.108926, -7.934776) " points="6.23206854 4.36834016 7.96339486 4.36903818 7.9857837 11.4273238 6.23206854 11.5012127"></polygon>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Icons / Actor / Physics / On-236</title>
<g id="Icons-/-Actor-/-Physics-/-On-2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<rect id="Rectangle-18" fill="#F5A623" x="0" y="0" width="24" height="24"></rect>
<path d="M13.1607746,19.9125407 L13.4277364,21.8988496 C12.9614267,21.9655098 12.4847411,22 12,22 C11.5152589,22 11.0385733,21.9655098 10.5722636,21.8988496 L10.8383137,19.9195317 C11.2097656,19.9725628 11.5894692,20 11.975581,20 C12.3783147,20 12.7740765,19.9701497 13.1607746,19.9125407 Z M9.33309696,19.5518252 L8.64013164,21.4215598 C7.73067722,21.097208 6.88197211,20.6449104 6.11568712,20.0863379 L7.27641932,18.4693068 C7.89959618,18.9244609 8.59127639,19.2914214 9.33309696,19.5518252 Z M16.7070306,18.4456003 L17.8843129,20.0863379 C17.1180279,20.6449104 16.2693228,21.097208 15.3598684,21.4215598 L14.6611298,19.5365683 C15.3994668,19.2725903 16.0875167,18.9028513 16.7070306,18.4456003 Z M19.136413,15.5402284 L20.9449276,16.4757101 C20.5259597,17.3114074 19.9933241,18.0802486 19.3672992,18.7619554 L17.8539722,17.4147018 C18.3655692,16.8570767 18.7988579,16.2264438 19.136413,15.5402284 Z M6.11955954,17.4389836 L4.63270084,18.7619554 C4.00667589,18.0802486 3.47404026,17.3114074 3.05507245,16.4757101 L4.82468892,15.5603633 C5.16573028,16.2487461 5.6032455,16.8808446 6.11955954,17.4389836 Z M2.00233104,11.7819136 L4.00296119,11.8049537 C4.00099128,11.8778688 4,11.9510281 4,12.024419 C4,12.746747 4.09602458,13.4466473 4.27600481,14.1120509 L2.3458237,14.6166472 C2.12031334,13.7826097 2,12.9053552 2,12 C2,11.9271198 2.00077964,11.8544217 2.00233104,11.7819136 Z M21.997,11.781838 L22,12 C22,12.9053552 21.8796867,13.7826097 21.6541763,14.6166472 L19.6783894,14.100064 C19.8562869,13.4382435 19.951162,12.7424109 19.951162,12.024419 L19.947,11.804838 L21.997,11.781838 Z M20.7406155,7.13811746 C21.2004923,7.96310941 21.546956,8.85996419 21.7589222,9.80759734 L19.7600141,10.2808906 C19.5892411,9.51507674 19.308349,8.79078455 18.9348194,8.12549542 Z M3.25938449,7.13811746 L5.0277097,8.10531853 C4.65031089,8.77294321 4.36635876,9.50037891 4.19361509,10.2698638 L2.24107782,9.80759734 C2.45304402,8.85996419 2.79950773,7.96310941 3.25938449,7.13811746 Z M17.5253214,3.66378461 C18.3013824,4.17919666 19.001332,4.80008536 19.604712,5.50599263 L18.0588119,6.86624006 C17.5687769,6.28889611 16.99802,5.78221727 16.3639789,5.36364109 Z M6.47467856,3.66378461 L7.62034128,5.34186903 C6.98217704,5.75863132 6.40737549,6.26433572 5.91353299,6.84138587 L4.39528799,5.50599263 C4.99866805,4.80008536 5.6986176,4.17919666 6.47467856,3.66378461 Z M12.9961055,2.04898934 C13.9670562,2.14500901 14.8971877,2.37990421 15.766361,2.73353598 L15.0080096,4.64555081 C14.3061207,4.35679187 13.5539699,4.16526555 12.7683267,4.08774124 Z M11.0048934,2.0488906 L11.2311007,4.08312606 C10.4436255,4.15602168 9.68933925,4.34339855 8.98504117,4.62845734 L8.23363905,2.73353598 C9.10311041,2.37978294 10.0335818,2.14484792 11.0048934,2.0488906 Z" id="Combined-Shape" fill="#FFFFFF"></path>
<polygon id="Polygon" fill="#FFFFFF" points="12 6 17.1961524 9 17.1961524 15 12 18 6.80384758 15 6.80384758 9"></polygon>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Icons / Actor / Joint / On-2</title>
<g id="Icons-/-Actor-/-Joint-/-On-2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<rect id="Icon-Background" fill="#F5A623" x="0" y="0" width="24" height="24"></rect>
<path d="M12,2 L19.7901934,17.0785082 C19.9261905,17.3743655 20,17.682873 20,18 C20,20.209139 16.418278,22 12,22 C7.581722,22 4,20.209139 4,18 C4,17.682873 4.0738095,17.3743655 4.21330769,17.0785381 L4.20985619,17.0785082 L12,2 Z M12,4.89163653 L12,20.1494944 C15.8659932,20.1494944 18.1892209,19.2050986 18.1892209,17.3273304 L18.1892209,17.3273304 L12,4.89163653 Z" id="Combined-Shape" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 865 B

@ -1,8 +1,13 @@
<RCC>
<qresource prefix="/EMotionFXAtom">
<file>Camera_category.svg</file>
<file>Cloth.svg</file>
<file>HitDetection.svg</file>
<file>RagdollCollider.svg</file>
<file>RagdollJointLimit.svg</file>
<file>Rotate.svg</file>
<file>Scale.svg</file>
<file>SimulatedObjectCollider.svg</file>
<file>Translate.svg</file>
<file>Visualization.svg</file>
</qresource>

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Icons / Actor / Physics / On-2</title>
<g id="Icons-/-Actor-/-Physics-/-On-2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<rect id="Rectangle-18" fill="#FF56DE" x="0" y="0" width="24" height="24"></rect>
<path d="M13.1607746,19.9125407 L13.4277364,21.8988496 C12.9614267,21.9655098 12.4847411,22 12,22 C11.5152589,22 11.0385733,21.9655098 10.5722636,21.8988496 L10.8383137,19.9195317 C11.2097656,19.9725628 11.5894692,20 11.975581,20 C12.3783147,20 12.7740765,19.9701497 13.1607746,19.9125407 Z M9.33309696,19.5518252 L8.64013164,21.4215598 C7.73067722,21.097208 6.88197211,20.6449104 6.11568712,20.0863379 L7.27641932,18.4693068 C7.89959618,18.9244609 8.59127639,19.2914214 9.33309696,19.5518252 Z M16.7070306,18.4456003 L17.8843129,20.0863379 C17.1180279,20.6449104 16.2693228,21.097208 15.3598684,21.4215598 L14.6611298,19.5365683 C15.3994668,19.2725903 16.0875167,18.9028513 16.7070306,18.4456003 Z M19.136413,15.5402284 L20.9449276,16.4757101 C20.5259597,17.3114074 19.9933241,18.0802486 19.3672992,18.7619554 L17.8539722,17.4147018 C18.3655692,16.8570767 18.7988579,16.2264438 19.136413,15.5402284 Z M6.11955954,17.4389836 L4.63270084,18.7619554 C4.00667589,18.0802486 3.47404026,17.3114074 3.05507245,16.4757101 L4.82468892,15.5603633 C5.16573028,16.2487461 5.6032455,16.8808446 6.11955954,17.4389836 Z M2.00233104,11.7819136 L4.00296119,11.8049537 C4.00099128,11.8778688 4,11.9510281 4,12.024419 C4,12.746747 4.09602458,13.4466473 4.27600481,14.1120509 L2.3458237,14.6166472 C2.12031334,13.7826097 2,12.9053552 2,12 C2,11.9271198 2.00077964,11.8544217 2.00233104,11.7819136 Z M21.997,11.781838 L22,12 C22,12.9053552 21.8796867,13.7826097 21.6541763,14.6166472 L19.6783894,14.100064 C19.8562869,13.4382435 19.951162,12.7424109 19.951162,12.024419 L19.947,11.804838 L21.997,11.781838 Z M20.7406155,7.13811746 C21.2004923,7.96310941 21.546956,8.85996419 21.7589222,9.80759734 L19.7600141,10.2808906 C19.5892411,9.51507674 19.308349,8.79078455 18.9348194,8.12549542 Z M3.25938449,7.13811746 L5.0277097,8.10531853 C4.65031089,8.77294321 4.36635876,9.50037891 4.19361509,10.2698638 L2.24107782,9.80759734 C2.45304402,8.85996419 2.79950773,7.96310941 3.25938449,7.13811746 Z M17.5253214,3.66378461 C18.3013824,4.17919666 19.001332,4.80008536 19.604712,5.50599263 L18.0588119,6.86624006 C17.5687769,6.28889611 16.99802,5.78221727 16.3639789,5.36364109 Z M6.47467856,3.66378461 L7.62034128,5.34186903 C6.98217704,5.75863132 6.40737549,6.26433572 5.91353299,6.84138587 L4.39528799,5.50599263 C4.99866805,4.80008536 5.6986176,4.17919666 6.47467856,3.66378461 Z M12.9961055,2.04898934 C13.9670562,2.14500901 14.8971877,2.37990421 15.766361,2.73353598 L15.0080096,4.64555081 C14.3061207,4.35679187 13.5539699,4.16526555 12.7683267,4.08774124 Z M11.0048934,2.0488906 L11.2311007,4.08312606 C10.4436255,4.15602168 9.68933925,4.34339855 8.98504117,4.62845734 L8.23363905,2.73353598 C9.10311041,2.37978294 10.0335818,2.14484792 11.0048934,2.0488906 Z" id="Combined-Shape" fill="#FFFFFF"></path>
<polygon id="Polygon" fill="#FFFFFF" points="12 6 17.1961524 9 17.1961524 15 12 18 6.80384758 15 6.80384758 9"></polygon>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

@ -301,7 +301,7 @@ namespace AZ::Render
RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs;
lineArgs.m_verts = m_auxVertices.data();
lineArgs.m_vertCount = static_cast<uint32_t>(m_auxVertices.size());
lineArgs.m_vertCount = aznumeric_cast<uint32_t>(m_auxVertices.size());
lineArgs.m_colors = m_auxColors.data();
lineArgs.m_colorCount = lineArgs.m_vertCount;
lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off;
@ -393,9 +393,9 @@ namespace AZ::Render
RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs;
lineArgs.m_verts = m_auxVertices.data();
lineArgs.m_vertCount = static_cast<uint32_t>(m_auxVertices.size());
lineArgs.m_vertCount = aznumeric_cast<uint32_t>(m_auxVertices.size());
lineArgs.m_colors = m_auxColors.data();
lineArgs.m_colorCount = static_cast<uint32_t>(m_auxColors.size());
lineArgs.m_colorCount = aznumeric_cast<uint32_t>(m_auxColors.size());
lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off;
auxGeom->DrawLines(lineArgs);
}
@ -464,15 +464,15 @@ namespace AZ::Render
m_auxVertices.emplace_back(normalPos);
m_auxVertices.emplace_back(normalPos + (normalDir * faceNormalsScale * scaleMultiplier));
}
}
RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs;
lineArgs.m_verts = m_auxVertices.data();
lineArgs.m_vertCount = static_cast<uint32_t>(m_auxVertices.size());
lineArgs.m_colors = &faceNormalsColor;
lineArgs.m_colorCount = 1;
lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off;
auxGeom->DrawLines(lineArgs);
RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs;
lineArgs.m_verts = m_auxVertices.data();
lineArgs.m_vertCount = aznumeric_cast<uint32_t>(m_auxVertices.size());
lineArgs.m_colors = &faceNormalsColor;
lineArgs.m_colorCount = 1;
lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off;
auxGeom->DrawLines(lineArgs);
}
}
// render vertex normals
@ -501,7 +501,7 @@ namespace AZ::Render
RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs;
lineArgs.m_verts = m_auxVertices.data();
lineArgs.m_vertCount = static_cast<uint32_t>(m_auxVertices.size());
lineArgs.m_vertCount = aznumeric_cast<uint32_t>(m_auxVertices.size());
lineArgs.m_colors = &vertexNormalsColor;
lineArgs.m_colorCount = 1;
lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off;
@ -589,9 +589,9 @@ namespace AZ::Render
RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs;
lineArgs.m_verts = m_auxVertices.data();
lineArgs.m_vertCount = static_cast<uint32_t>(m_auxVertices.size());
lineArgs.m_vertCount = aznumeric_cast<uint32_t>(m_auxVertices.size());
lineArgs.m_colors = m_auxColors.data();
lineArgs.m_colorCount = static_cast<uint32_t>(m_auxColors.size());
lineArgs.m_colorCount = aznumeric_cast<uint32_t>(m_auxColors.size());
lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off;
auxGeom->DrawLines(lineArgs);
}
@ -649,7 +649,7 @@ namespace AZ::Render
RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs;
lineArgs.m_verts = m_auxVertices.data();
lineArgs.m_vertCount = static_cast<uint32_t>(m_auxVertices.size());
lineArgs.m_vertCount = aznumeric_cast<uint32_t>(m_auxVertices.size());
lineArgs.m_colors = &wireframeColor;
lineArgs.m_colorCount = 1;
lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off;
@ -688,7 +688,7 @@ namespace AZ::Render
m_drawParams.m_drawViewportId = viewportContext->GetId();
AzFramework::WindowSize viewportSize = viewportContext->GetViewportSize();
m_drawParams.m_position = AZ::Vector3(static_cast<float>(viewportSize.m_width), 0.0f, 1.0f) +
m_drawParams.m_position = AZ::Vector3(aznumeric_cast<float>(viewportSize.m_width), 0.0f, 1.0f) +
TopRightBorderPadding * viewportContext->GetDpiScalingFactor();
m_drawParams.m_scale = AZ::Vector2(BaseFontSize);
m_drawParams.m_hAlign = AzFramework::TextHorizontalAlignment::Right;

@ -79,11 +79,16 @@ namespace EMStudio
// [EMFX-TODO] Add those option once implemented.
// CreateViewOptionEntry(contextMenu, "Actor Bind Pose", EMotionFX::ActorRenderFlag::RENDER_ACTORBINDPOSE);
contextMenu->addSeparator();
CreateViewOptionEntry(contextMenu, "Hit Detection Colliders", EMotionFX::ActorRenderFlag::RENDER_HITDETECTION_COLLIDERS);
CreateViewOptionEntry(contextMenu, "Ragdoll Colliders", EMotionFX::ActorRenderFlag::RENDER_RAGDOLL_COLLIDERS);
CreateViewOptionEntry(contextMenu, "Ragdoll Joint Limits", EMotionFX::ActorRenderFlag::RENDER_RAGDOLL_JOINTLIMITS);
CreateViewOptionEntry(contextMenu, "Cloth Colliders", EMotionFX::ActorRenderFlag::RENDER_CLOTH_COLLIDERS);
CreateViewOptionEntry(contextMenu, "Simulated Object Colliders", EMotionFX::ActorRenderFlag::RENDER_SIMULATEDOBJECT_COLLIDERS);
CreateViewOptionEntry(contextMenu, "Hit Detection Colliders", EMotionFX::ActorRenderFlag::RENDER_HITDETECTION_COLLIDERS, true,
":/EMotionFXAtom/HitDetection.svg");
CreateViewOptionEntry(contextMenu, "Ragdoll Colliders", EMotionFX::ActorRenderFlag::RENDER_RAGDOLL_COLLIDERS, true,
":/EMotionFXAtom/RagdollCollider.svg");
CreateViewOptionEntry(contextMenu, "Ragdoll Joint Limits", EMotionFX::ActorRenderFlag::RENDER_RAGDOLL_JOINTLIMITS, true,
":/EMotionFXAtom/RagdollJointLimit.svg");
CreateViewOptionEntry(contextMenu, "Cloth Colliders", EMotionFX::ActorRenderFlag::RENDER_CLOTH_COLLIDERS, true,
":/EMotionFXAtom/Cloth.svg");
CreateViewOptionEntry(contextMenu, "Simulated Object Colliders", EMotionFX::ActorRenderFlag::RENDER_SIMULATEDOBJECT_COLLIDERS, true,
":/EMotionFXAtom/SimulatedObjectCollider.svg");
CreateViewOptionEntry(contextMenu, "Simulated Joints", EMotionFX::ActorRenderFlag::RENDER_SIMULATEJOINTS);
}
@ -153,7 +158,7 @@ namespace EMStudio
}
void AnimViewportToolBar::CreateViewOptionEntry(
QMenu* menu, const char* menuEntryName, uint32_t actionIndex, bool visible, char* iconFileName)
QMenu* menu, const char* menuEntryName, uint32_t actionIndex, bool visible, const char* iconFileName)
{
QAction* action = menu->addAction(
menuEntryName,

@ -30,7 +30,7 @@ namespace EMStudio
private:
void CreateViewOptionEntry(
QMenu* menu, const char* menuEntryName, uint32_t actionIndex, bool visible = true, char* iconFileName = nullptr);
QMenu* menu, const char* menuEntryName, uint32_t actionIndex, bool visible = true, const char* iconFileName = nullptr);
AtomRenderPlugin* m_plugin = nullptr;
QAction* m_manipulatorActions[RenderOptions::ManipulatorMode::NUM_MODES] = { nullptr };

Loading…
Cancel
Save