Git Product home page Git Product logo

Comments (8)

jtran56 avatar jtran56 commented on August 17, 2024

Filed as internal issue #137455.

from openusd.

spiffmon avatar spiffmon commented on August 17, 2024

Hi Eoin,
Good observation that starting a new Maya scene should cause all state to be flushed, including the StageCache. Does Maya have a hook we can latch onto at "New" to clear the StageCache?

You should never need to worry about the Sdf_LayerRegistry, because it only holds weak references to SdfLayers, and therefore will never keep them alive - that's what allows us to keep the registry as an internal detail.
If you have verified that the StageCache is indeed being flushed (you can set the TF_DEBUG env var to "USD_STAGE_CACHE" for diagnostics), then my suspicion is that either the PluginStaticData for the maya usd proxyShape is not being released (it holds a strong pointer to the stage), or Maya is not guaranteeing that the old nodes are fully decomissioned prior to creating any new nodes.
I don't know anything about Maya plugin object lifetime management, but I'll check with our experts.

Cheers,
--spiff

from openusd.

murphyeoin avatar murphyeoin commented on August 17, 2024

Hi Spiff,
the stageCache is being cleared on maya new scene/open scene/close scene events, that's working OK
Thanks for the insight into the layerRegistry behaviour - makes sense.

One of our Maya gurus has already fingered MpxData (https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/Maya-SDK/cpp-ref/class-m-px-data-html.html) as a likely suspect, and it's derived type MPxGeometryData is used in https://github.com/PixarAnimationStudios/USD/blob/2eb01f5cd4c2dae4e1ef9912ca27a93083bb6ef4/third_party/maya/lib/usdMaya/stageData.h... so it sounds like the culprit might either be in PluginStaticData or stageData... I will follow up with him tomorrow, but would be great to see if anyone at Pixar has any ideas - can also talk to the Autodesk Maya peeps and see what they think.
Thanks!
Eoin

from openusd.

murphyeoin avatar murphyeoin commented on August 17, 2024

Hi Spiff and the rest of team USD,
did a bit more digging into this, and it looks like maybe the MPxData is not responsible after all (although not definitive)

If I run my code above that mutates the layer, then I do

from maya import cmds
cmds.file(new=True, force=True)
cmds.unloadPlugin('pxrUsd')

Then -

from pxr import Sdf
layers = Sdf.Layer.GetLoadedLayers()
for currLayer in layers:
    print currLayer

we can see that it's still hanging onto the layer we originally loaded, plus it's session layer, even though the USDMaya plugin is unloaded.
What's nasty is that the session layers keep accumulating (as a new one is created for each session) on each file new.
I did put some print statements in the USDMaya plugin to see if things were being destroyed correctly - and it mostly looked like they were... but that's not definitive

Luckily, I now have a workaround, which is on file close/new event, I can run something like this (or the C++ equivalent)

layers = Sdf.Layer.GetLoadedLayers()
for l in layers:
    l.Reload()

Thanks

from openusd.

spiffmon avatar spiffmon commented on August 17, 2024

Hey Eoin,
Matt Johnson found the problem - something in our maya imaging adapter was not getting reset properly and hanging onto strong pointers to the stage. Fix is IP.

--spiff

On Sep 25, 2016, at 9:54 PM, murphyeoin [email protected] wrote:

Hi Spiff and the rest of team USD,
did a bit more digging into this, and it looks like maybe the MPxData is not responsible after all (although not definitive)

If I run my code above that mutates the layer, then I do

from maya import cmds
cmds.file(new=True, force=True)
cmds.unloadPlugin('pxrUsd')
Then -

from pxr import Sdf
layers = Sdf.Layer.GetLoadedLayers()
for currLayer in layers:
print currLayer
we can see that it's still hanging onto the layer we originally loaded, plus it's session layer, even though the USDMaya plugin is unloaded.
What's nasty is that the session layers keep accumulating (as a new one is created for each session) on each file new.
I did put some print statements in the USDMaya plugin to see if things were being destroyed correctly - and it mostly looked like they were... but that's not definitive

Luckily, I now have a workaround, which is on file close/new event, I can run something like this (or the C++ equivalent)

layers = Sdf.Layer.GetLoadedLayers()
for l in layers:
l.Reload()
Thanks


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

from openusd.

murphyeoin avatar murphyeoin commented on August 17, 2024

Hi Spiff.. great! Send our thanks to Matt for figuring that one out - a few of us spent a couple of hours on it with no luck.
Thanks
Eoin

from openusd.

sunyab avatar sunyab commented on August 17, 2024

This issue should be fixed by commit 3482797 in the dev branch.

from openusd.

sunyab avatar sunyab commented on August 17, 2024

Commit has been merged into release v0.7.2, closing.

from openusd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.