On Tue, 20 Jul 2021, 1:32 pm Totally Zen, <atu...@gmail.com> wrote: > this command: > pmc.system.openFile(sceneNameToOpen, force=True, loadReferenceDepth = > 'none', buildLoadSettings=True) > result: > # C:/my_scene/animal_RIG_A001.v002.mb > # C:/my_scene/animal_RIG_A001.v002.mb > # C:/my_scene/animal_RIG_A001.v002.mb >
You started here by using the pymel api. > nsettings = range(cmds.selLoadSettings(numSettings=1, query=1)) > ids = [str(i) for i in nsettings if i] > result = cmds.selLoadSettings(ids, fileName=1, query=1) > print result > result: > [u'C:/my_scene/animal_RIG_A001.v002.mb', > u'C:/my_scene/animal_RIG_A001.v002.mb', > u'C:/my_scene/animal_RIG_A001.v002.mb'] > > for item in result: > item.load() > ERROR: > Error: AttributeError: file <maya console> line 27: 'unicode' object has > no attribute 'load' # > > This is because my result type is coming "unicode" and not as a : <class > 'pymel.core.system.FileReference'> > But then you switched to using the commands api which only deals in strings. You should keep using pymel if that it what you wanted. https://help.autodesk.com/cloudhelp/2018/JPN/Maya-Tech-Docs/PyMel/generated/functions/pymel.core.system/pymel.core.system.selLoadSettings.html > and remembering that I want to run my code to find the references and > enable and disable without having to load it into maya. > > > Em segunda-feira, 19 de julho de 2021 às 22:18:07 UTC-3, > justin...@gmail.com escreveu: > >> Did you give it a try with mayapy.exe? >> >> >> https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/Maya/files/GUID-83799297-C629-48A8-BCE4-061D3F275215-htm.html >> >> On Tue, 20 Jul 2021, 11:36 am Totally Zen, <atu...@gmail.com> wrote: >> >>> I need to open a scene without loading in maya and get its references, >>> to later work on some to load() correctly >>> *** I would like to use only pymel *** >>> >>> code example: >>> import maya.cmds as cmds >>> sceneNameToOpen = "C:\my_scene\animal.mb" >>> >>> cmds.file(sceneNameToOpen, loadReferenceDepth = 'none', open=1, >>> buildLoadSettings=1): >>> mel.eval('PreloadReferenceEditor;') >>> >>> -- >>> 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_m...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/python_inside_maya/cbedc1bf-2d09-4921-8d95-8795855708d1n%40googlegroups.com >>> <https://groups.google.com/d/msgid/python_inside_maya/cbedc1bf-2d09-4921-8d95-8795855708d1n%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/b9ef65e8-d4c0-4cad-b062-04b0d2662ff2n%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/b9ef65e8-d4c0-4cad-b062-04b0d2662ff2n%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/CAPGFgA2aK%2Bcd_tXmWLgYZf%2BnYWDb49P6a1Ldk-wQ9tpUT1YL6g%40mail.gmail.com.