diff --git a/lib/mayaHydra/hydraExtensions/adapters/aiSkydomeLightAdapter.cpp b/lib/mayaHydra/hydraExtensions/adapters/aiSkydomeLightAdapter.cpp index 0f94c8257a..7dc58be067 100644 --- a/lib/mayaHydra/hydraExtensions/adapters/aiSkydomeLightAdapter.cpp +++ b/lib/mayaHydra/hydraExtensions/adapters/aiSkydomeLightAdapter.cpp @@ -104,7 +104,8 @@ class MayaHydraAiSkyDomeLightAdapter : public MayaHydraLightAdapter // We are not using precomputed attributes here, because we don't have // a guarantee that mtoa will be loaded before mayaHydra. - if (paramName == HdLightTokens->color) { + if (paramName == HdLightTokens->color || + paramName == UsdLuxTokens->inputsColor) { const auto plug = light.findPlug("color", true); MPlugArray conns; plug.connectedTo(conns, true, false); @@ -150,23 +151,29 @@ class MayaHydraAiSkyDomeLightAdapter : public MayaHydraLightAdapter } } return VtValue(GfVec3f(r,g,b)); - } else if (paramName == HdLightTokens->intensity) { + } else if (paramName == HdLightTokens->intensity || + paramName == UsdLuxTokens->inputsIntensity) { return VtValue(light.findPlug("intensity", true).asFloat()); - } else if (paramName == HdLightTokens->diffuse) { + } else if (paramName == HdLightTokens->diffuse || + paramName == UsdLuxTokens->inputsDiffuse) { MPlug aiDiffuse = light.findPlug("aiDiffuse", true, &status); if (status == MS::kSuccess) { return VtValue(aiDiffuse.asFloat()); } - } else if (paramName == HdLightTokens->specular) { + } else if (paramName == HdLightTokens->specular || + paramName == UsdLuxTokens->inputsSpecular) { MPlug aiSpecular = light.findPlug("aiSpecular", true, &status); if (status == MS::kSuccess) { return VtValue(aiSpecular.asFloat()); } - } else if (paramName == HdLightTokens->exposure) { + } else if (paramName == HdLightTokens->exposure || + paramName == UsdLuxTokens->inputsExposure) { return VtValue(light.findPlug("aiExposure", true).asFloat()); - } else if (paramName == HdLightTokens->normalize) { + } else if (paramName == HdLightTokens->normalize || + paramName == UsdLuxTokens->inputsNormalize) { return VtValue(light.findPlug("aiNormalize", true).asBool()); - } else if (paramName == HdLightTokens->textureFormat) { + } else if (paramName == HdLightTokens->textureFormat || + paramName == UsdLuxTokens->inputsTextureFormat) { const auto format = light.findPlug("format", true).asShort(); // mirrored_ball : 0 // angular : 1 @@ -178,7 +185,8 @@ class MayaHydraAiSkyDomeLightAdapter : public MayaHydraLightAdapter } else { return VtValue(UsdLuxTokens->automatic); } - } else if (paramName == HdLightTokens->textureFile) { + } else if (paramName == HdLightTokens->textureFile || + paramName == UsdLuxTokens->inputsTextureFile) { // Be aware that dome lights in HdStorm always need a texture to work correctly, // the color is not used if no texture is present. @@ -220,7 +228,8 @@ class MayaHydraAiSkyDomeLightAdapter : public MayaHydraLightAdapter // SdfAssetPath requires both "path" "resolvedPath" return VtValue(SdfAssetPath(fileTextureName, fileTextureName)); - } else if (paramName == HdLightTokens->enableColorTemperature) { + } else if (paramName == HdLightTokens->enableColorTemperature || + paramName == UsdLuxTokens->inputsEnableColorTemperature) { return VtValue(false); } return {}; diff --git a/lib/mayaHydra/hydraExtensions/adapters/renderItemAdapter.cpp b/lib/mayaHydra/hydraExtensions/adapters/renderItemAdapter.cpp index 941fa0d6ef..0dddc8b718 100644 --- a/lib/mayaHydra/hydraExtensions/adapters/renderItemAdapter.cpp +++ b/lib/mayaHydra/hydraExtensions/adapters/renderItemAdapter.cpp @@ -154,19 +154,12 @@ void MayaHydraRenderItemAdapter::UpdateFromDelta(const UpdateFromDeltaData& data dirtyBits |= HdChangeTracker::DirtyPrimvar; // displayColor primVar } - const bool displayStatusChanged = (_displayStatus != data._displayStatus); - _displayStatus = data._displayStatus; const bool hideOnPlayback = data._ri.isHideOnPlayback(); if (hideOnPlayback != _isHideOnPlayback) { _isHideOnPlayback = hideOnPlayback; dirtyBits |= HdChangeTracker::DirtyVisibility; } - //Special case for aiSkydomeLight which is visible only when it is selected - if (_isArnoldSkyDomeLightTriangleShape && displayStatusChanged){ - SetVisible(IsRenderItemSelected()); - dirtyBits |= HdChangeTracker::DirtyVisibility; - } else if (visibChanged) { SetVisible(visible); dirtyBits |= HdChangeTracker::DirtyVisibility; @@ -523,12 +516,6 @@ void MayaHydraRenderItemAdapter::SetPlaybackChanged() } } -bool MayaHydraRenderItemAdapter::IsRenderItemSelected() const -{ - return (MHWRender::DisplayStatus::kActive == _displayStatus) || - (MHWRender::DisplayStatus::kLead == _displayStatus); -} - HdCullStyle MayaHydraRenderItemAdapter::GetCullStyle() const { // HdCullStyleNothing means no culling, HdCullStyledontCare means : let the renderer choose diff --git a/lib/mayaHydra/hydraExtensions/adapters/renderItemAdapter.h b/lib/mayaHydra/hydraExtensions/adapters/renderItemAdapter.h index 636802d95b..67e9db4647 100644 --- a/lib/mayaHydra/hydraExtensions/adapters/renderItemAdapter.h +++ b/lib/mayaHydra/hydraExtensions/adapters/renderItemAdapter.h @@ -113,9 +113,6 @@ class MayaHydraRenderItemAdapter : public MayaHydraAdapter MAYAHYDRALIB_API const MColor& GetWireframeColor() const { return _wireframeColor; } - MAYAHYDRALIB_API - MHWRender::DisplayStatus GetDisplayStatus() const { return _displayStatus; } - MAYAHYDRALIB_API GfMatrix4d GetTransform() override { return _transform[0]; } @@ -139,19 +136,16 @@ class MayaHydraRenderItemAdapter : public MayaHydraAdapter UpdateFromDeltaData( MRenderItem& ri, unsigned int flags, - const MColor& wireframeColor, - MHWRender::DisplayStatus displayStatus) + const MColor& wireframeColor) : _ri(ri) , _flags(flags) , _wireframeColor(wireframeColor) - , _displayStatus(displayStatus) { } MRenderItem& _ri; unsigned int _flags; const MColor& _wireframeColor; - MHWRender::DisplayStatus _displayStatus; }; /// We receive in that function the changes made in the Maya viewport between the last frame @@ -192,9 +186,6 @@ class MayaHydraRenderItemAdapter : public MayaHydraAdapter MAYAHYDRALIB_API bool GetIsRenderITemAnaiSkydomeLightTriangleShape() const {return _isArnoldSkyDomeLightTriangleShape;} - MAYAHYDRALIB_API - bool IsRenderItemSelected() const; - private: MAYAHYDRALIB_API void _RemoveRprim(); @@ -216,7 +207,6 @@ class MayaHydraRenderItemAdapter : public MayaHydraAdapter bool _visible = false; MColor _wireframeColor = { 1.f, 1.f, 1.f, 1.f }; bool _isHideOnPlayback = false; - MHWRender::DisplayStatus _displayStatus = MHWRender::DisplayStatus::kNoStatus; bool _isArnoldSkyDomeLightTriangleShape = false; GfBBox3d _bounds;//Bounding box }; diff --git a/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraSceneIndex.cpp b/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraSceneIndex.cpp index 8e7d7e88db..869b8dbda1 100644 --- a/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraSceneIndex.cpp +++ b/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraSceneIndex.cpp @@ -183,6 +183,16 @@ namespace { return mayaPath; } + bool IsTexturedSkyDomeRenderItem(const SdfPath& name) + { + static const std::string _aiTexturedSkyDome("texturedSkyDome"); + if (name.GetString().find(_aiTexturedSkyDome) != std::string::npos) { + // This render item is an texturedDomeLighnt + return true; + } + return false; + } + SdfPath _GetPrimPath(const SdfPath& base, const MDagPath& dg) { return base.AppendPath(GetMayaPrimPath(dg)); @@ -474,7 +484,10 @@ void MayaHydraSceneIndex::HandleCompleteViewportScene(const MDataServerOperation MayaHydraRenderItemAdapterPtr ria = nullptr; if (!_GetRenderItem(fastId, ria)) { const SdfPath slowId = _GetRenderItemPrimPath(ri); - if (slowId.IsEmpty()) { + + // Maya/MtoA adds texturedSkyDome mesh object for VP2. + // We do not want that to be translated to Hydra + if (slowId.IsEmpty() || IsTexturedSkyDomeRenderItem(slowId)) { continue; } // MAYA-128021: We do not currently support maya instances. @@ -500,18 +513,16 @@ void MayaHydraSceneIndex::HandleCompleteViewportScene(const MDataServerOperation } MColor wireframeColor; - MHWRender::DisplayStatus displayStatus = MHWRender::kNoStatus; MDagPath dagPath = ri.sourceDagPath(); if (dagPath.isValid()) { wireframeColor = MGeometryUtilities::wireframeColor( dagPath); // This is a color managed VP2 color, it will need to be unmanaged at some // point - displayStatus = MGeometryUtilities::displayStatus(dagPath); } const MayaHydraRenderItemAdapter::UpdateFromDeltaData data( - ri, flags, wireframeColor, displayStatus); + ri, flags, wireframeColor); ria->UpdateFromDelta(data); if (flags & MDataServerOperation::MViewportScene::MVS_changedMatrix) { ria->UpdateTransform(ri);