Re: [Maya-Python] List referenced files

2015-08-11 Thread Roy Nieterau
Ok, so the filePathEditor command does allow you to retrieve the attribute belonging to a certain file. So I assume it would also allow you to query the unresolved path? from maya import cmds def grouper(iterable, n, fillvalue=None): "Collect data into fixed-length chunks or blocks" # g

Re: [Maya-Python] List referenced files

2015-08-11 Thread Geordie Martinez
there used to be a script on creative crash called "File Path Manager" that did this with textures On Tue, Aug 11, 2015 at 9:59 PM, Geordie Martinez wrote: > pymel is super useful for this > > import pymel.core as pm > # GET A LIST OF REFERENCES > refs = pm.listReferences() > # LOOP THROUGH AND

Re: [Maya-Python] List referenced files

2015-08-11 Thread Geordie Martinez
pymel is super useful for this import pymel.core as pm # GET A LIST OF REFERENCES refs = pm.listReferences() # LOOP THROUGH AND PRINT THE PATH# for ref in refs: # PATH print("path: %s"% ref.path) # NAMESPACE print("namespace: %s" % ref.namespace) On Tue, Aug 11, 2015 at 1:34

Re: [Maya-Python] Re: Combined Texture Channel

2015-08-11 Thread Kurian O.S
Thanks :) On Fri, Aug 7, 2015 at 12:54 PM, Ahmet Levent Tasel wrote: > try this :) > > import maya.cmds as cmds > > > shaderNode = '' > if cmds.objExists(shaderNode): > materialInfoNode = cmds.ls(cmds.listConnections(shaderNode), typ= > 'materialInfo')[-1] > cmds.connectAttr('%s.message'

[Maya-Python] Querying colorset indices

2015-08-11 Thread Farhan Noor
Heya, I recently made a cleanup script that would go through a bunch of specific things including UVsets and colorsets and remove any extraneous ones on selected meshes. While I wrote a working function to check / remove colorsets, can't help but feel there was a better way. With UVsets I c

Re: [Maya-Python] List referenced files

2015-08-11 Thread Sivanny Selvakumar
`file -q -list` will return all the file reference paths and string attributes marked as usedAsFilename. So it saves you from having to iterate over the nodes in the scene yourself. This is how Maya gets a list of files for the File > Archive Scene feature. You can also access this functionalit

Re: [Maya-Python] List referenced files

2015-08-11 Thread damon shelton
Also, you can use listAttr to list attrs that are usedAsFilename. Command only returns attribute name but then you can loop through getting all objects with attribute name and querying it and checking the path. you can also list string attributes if you want to take it further, you would have to tu

Re: [Maya-Python] List referenced files

2015-08-11 Thread Robert White
So if you want the texture file nodes in the scene, you can get them from pymel with: import pymel.core as pm file_nodes = pm.ls(type=pm.nt.File) file_paths = [fyle.fileTextureName.get() for fyle in file_nodes] with cmds: import maya.cmds as cmds file_nodes = cmds.ls(type='file') file_paths = [c

Re: [Maya-Python] List referenced files

2015-08-11 Thread Marcus Ottosson
Thanks guys for a quick reply. @Arvid and Fredrik: Would it possible to share this dictionary? On 11 August 2015 at 20:23, Robert White wrote: > So if you want the texture file nodes in the scene, you can get them from > pymel with: > > import pymel.core as pm > file_nodes = pm.ls(type=pm.nt.Fi

Re: [Maya-Python] List referenced files

2015-08-11 Thread Fredrik Averpil
> Oh, you're just talking about Maya references? Sorry, getting tired :) re-read your initial question and I still don't think you can do what you want to achieve without parsing all nodes and all their attributes and then filter the value manually in order to determine whether the value is a fold

Re: [Maya-Python] List referenced files

2015-08-11 Thread Fredrik Averpil
Oh, you're just talking about Maya references? I thought you wanted to find e.g. ies files or vrmesh files etc and other files which are "referenced" (without being a "Maya reference"). tis 11 aug 2015 kl. 19:18 skrev Fredrik Averpil : > I ended up making a dictionary of nodes and attributes and

Re: [Maya-Python] List referenced files

2015-08-11 Thread Fredrik Averpil
I ended up making a dictionary of nodes and attributes and query these "manually" since there is (to my understanding) no way to really just find all filepaths existing in some shape or form in the scene. Just think about plugins. You can never know if the developer properly registered the attribu

Re: [Maya-Python] List referenced files

2015-08-11 Thread damon shelton
I would look at the referenceQuery cmd. this will let you query the unresolved path as well as use this command to tell if a particular node is referenced or not. I think this command is exactly what you need. On Tue, Aug 11, 2015 at 10:11 AM, Arvid Schneider wrote: > I did a similiar thing..but

Re: [Maya-Python] List referenced files

2015-08-11 Thread Arvid Schneider
I did a similiar thing..but it wasnt a one function solution. Its tool which catches all paths ( files ) and copies them to a given directory and remaps all the paths to the new set directory. To get it to work though, I created a dictionary with nodeType and path attribute eg. file:filepath etc. A

[Maya-Python] Maya Output Window in cmd terminal.

2015-08-11 Thread Macbeth R.
In windows, is there a way to open Maya via the terminal (cmd), and get all the output to it?, like in OSX and Linux behavior. Without the need of the secondary output white window. Thanks for your tips! -- You received this message because you are subscribed to the Google Groups "Python Prog

Re: [Maya-Python] List referenced files

2015-08-11 Thread Marcus Ottosson
Also, importantly, I’d like their unresolved entry, no the resolve one. The command above only returns resolved paths. # Right$ROOT/parent/file.mb # Wrong /server/projects/myproject/parent/file.mb ​ On 11 August 2015 at 16:59, Marcus Ottosson wrote: > I’m looking for a way to list all nodes th

[Maya-Python] List referenced files

2015-08-11 Thread Marcus Ottosson
I’m looking for a way to list all nodes that somehow reference an external file; be it references, textures, or some obscure custom node with an attribute for paths. I was looking at the cmds.filePathEditor

Re: [Maya-Python] Pyblish By Example

2015-08-11 Thread Marcus Ottosson
> Also, if a context is something that gets shared throughout plugins, is there any reason not to make it immediately available as a member attribute on the plugin instance? Is it expensive to generate, if the plugin isn't requesting one? If so, you could always make it a context() call or a comput

Re: [Maya-Python] Pyblish By Example

2015-08-11 Thread Justin Israel
On Tue, 11 Aug 2015 10:01 PM Marcus Ottosson wrote: If the tutorial just said plainly that the goal is to raise any exception if validation fails, that would be clear enough. Not sure if you missed it, or if you think the current phrasing isn’t enough, but it does include that any exception is

Re: [Maya-Python] Pyblish By Example

2015-08-11 Thread Marcus Ottosson
If the tutorial just said plainly that the goal is to raise any exception if validation fails, that would be clear enough. Not sure if you missed it, or if you think the current phrasing isn’t enough, but it does include that any exception is ok. “We indicate failure by throwing exceptions of any

Re: [Maya-Python] Pyblish By Example

2015-08-11 Thread Justin Israel
On Tue, Aug 11, 2015 at 7:37 PM Marcus Ottosson wrote: > Re: The quickstart showed 4 different plugin classes that were used. It > would be nice if you first just quickly said something like “pyblish has a > number of task oriented classes to derive from. these 4 do xyz”. Just a > short sentence

Re: [Maya-Python] Pyblish By Example

2015-08-11 Thread Marcus Ottosson
Re: The quickstart showed 4 different plugin classes that were used. It would be nice if you first just quickly said something like “pyblish has a number of task oriented classes to derive from. these 4 do xyz”. Just a short sentence on the purpose of each one. I agree, done. - http://forums.p