That definitely should work, independent of references. How can I reproduce
what you see?

Here’s what I see:

from maya import cmds
# Make an original scene to reference
cmds.polyCube()
cmds.file(rename="referenceMe.ma")
cmds.file(save=True, type="mayaAscii")
# Make a new scene, and reference the original scene
cmds.file(new=True, force=True)
cmds.file("referenceMe.ma", reference=True)
cmds.file(rename="newScene.ma")

fname = cmds.file(query=True, sceneName=True)assert
fname.endswith("newScene.ma")


On Tue, 14 Nov 2023 at 16:50, Utkarsh Agnihotri <utkarsh6...@gmail.com>
wrote:

> Hi,
>
> I am trying to query Maya scene name and path using
>
> main_scene_file = cmds.file(q=True, sceneName=True)
>
> But it doesn't work when there are references in the scene. Does anyone
> how can I fix that?
>
> Thanks :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/f11a3271-498a-4857-8a8b-a12e171086e4n%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/f11a3271-498a-4857-8a8b-a12e171086e4n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODh9pD7iuHHbUG3EfX8VV3ukO-k-R97LqkNSqYNDCFOfA%40mail.gmail.com.

Reply via email to