Re: [Maya-Python] Re: Remove reference edits via Python?

2014-10-31 Thread Fredrik Averpil
Hi Luke, this is very useful. I save out all the edits to an editMB file before cleaning it. And when I save out that file as well as when I re-apply it later down the road, Maya crashes sporadically. Currently, I’m not unloading the reference when performing the edits export and the edits

Re: [Maya-Python] Re: Remove reference edits via Python?

2014-10-31 Thread Fredrik Averpil
Whoops … I meant to write that Maya crashes when I export the editMB (sometimes) and later down the road it also crashes (sometimes) when I save down the edits into the actual scene (“Save reference edits”). By the way, this is how I save down the reference edits on a loaded reference: filepath

Re: [Maya-Python] Re: Remove reference edits via Python?

2014-10-31 Thread Marcus Ottosson
Crashing reference updates is surprisingly common I think. One stable way I've gone about it in the past is to update the .ma file. The results are the same, except Maya won't have to keep the old and new reference in memory while switching; which has been, in my experience, the cause of the

Re: [Maya-Python] me podrian indicar como aprender lenguaje python y aplicarlo en maya entenderlo

2014-10-31 Thread Ricardo Viana
Sugiro que aprendas el ingles primero. Despues aprendes Python en la web. Es gratuito en muchos sítios. Como learntocode thehardway (Google it). On Wednesday, October 29, 2014, Juan Carlos Chavez hernandez cerebrodigita...@gmail.com wrote: hla perdone pero necesito aprender comprender y

Re: [Maya-Python] Re: Remove reference edits via Python?

2014-10-31 Thread Fredrik Averpil
One stable way I've gone about it in the past is to update the .ma file. How do you mean, exactly? Do you mean launching a separate process such as maya -batch -command [mel code] -file hello.ma or do you mean reading in the .ma contents and modifying it with Python? ​ -- You received this

Re: [Maya-Python] Re: Remove reference edits via Python?

2014-10-31 Thread Marcus Ottosson
You can either modify the .ma in a text-editor, as it is text, or through Python via something like regular expressions. Each reference will be clearly prefixed by it's unique command in the header of the file, along with its absolute path. On 31 October 2014 08:15, Fredrik Averpil

Re: [Maya-Python] Re: Remove reference edits via Python?

2014-10-31 Thread Eduardo Grana
Hello Fredrik, Regarding the remove all edits, have you tryed the referenceEdit command with the flag *removeEdits?*probably is safer, but you have to unload the reference first. Cheers! Eduardo On Fri, Oct 31, 2014 at 5:27 AM, Marcus Ottosson konstrukt...@gmail.com wrote: You can either modify

Re: [Maya-Python] related to Maya Array Attribute, having compound child.

2014-10-31 Thread Eduardo Grana
Hello Hyun, I may be misunderstanding the question, but I'll give it a try if you don't mind ;) As far as I know, when you have attributes and they have the default value, maya doesn't save them anywhere, and when you ask for them, the default value is returned ( and sometimes only the values that

[Maya-Python] MObject unique ID's

2014-10-31 Thread Mark Jackson
Hi all, I'm revisiting the Red9_Meta caching setup and am looking at the possibility of using the MObjectHandles hashID as a key in the MetaCache that I build up, currently I store the key as the dag path which is obviously not optimal. The cache saves any object being instantiated twice by the

Re: [Maya-Python] me podrian indicar como aprender lenguaje python y aplicarlo en maya entenderlo

2014-10-31 Thread Eduardo Grana
Hola Juan Carlos, Te paso unos links... (I'm sending you some links) Aqui documentacion de python en español (Here you have spanish documentation for python) http://pyspanishdoc.sourceforge.net/ Y aqui, un tutorial en español, o en castellano, como decimos los argentinos ;) (And here you have a

Re: [Maya-Python] MObject unique ID's

2014-10-31 Thread Justin Israel
Sounds like what you want to do is cache on the hash code combined with a type identifier, since seems a hash code may not be unique across different types. On Sat, 1 Nov 2014 12:07 AM Mark Jackson mark...@gmail.com wrote: Hi all, I'm revisiting the Red9_Meta caching setup and am looking at

Re: [Maya-Python] MObject unique ID's

2014-10-31 Thread David Moulder
Hi Mark, Hows things? I think the MObjectHandle is returning the its MObject.__hash__() and as 2 MObjectHandles can point to the same MObject you'll get the same uuid. -Dave On Fri, Oct 31, 2014 at 11:07 AM, Mark Jackson mark...@gmail.com wrote: Hi all, I'm revisiting the Red9_Meta caching

Re: [Maya-Python] MObject unique ID's

2014-10-31 Thread Mark Jackson
yeah, that's pretty much what I thought, just checking before I ditch the idea, if I'm going to be checking the hashID against the node Type in-order to extract a matching key from the dict then I may as well just revert to the system I had. Not that big a hit to re-instantiate the node if

Re: [Maya-Python] Re: Remove reference edits via Python?

2014-10-31 Thread Fredrik Averpil
Yes, however, that just simply does not work at all. Try this; for ref in cmds.ls(references=True): cmds.referenceEdit( ref, removeEdits=True) Here in my scene, nothing happens. No reference edits was removed. On Fri, Oct 31, 2014 at 11:56 AM, Eduardo Grana eduardo.gr...@gmail.com wrote:

Re: [Maya-Python] Re: Remove reference edits via Python?

2014-10-31 Thread Eduardo Grana
Hey Fredrik, Your right, it doesn't do anything! hahaha try this: import maya.cmds as cmds for ref in cmds.ls(references=True): cmds.file(unloadReference=ref) cmds.file (cr=ref) # *cleanReference* thats how the reference editor does it... (C:/Program

Re: [Maya-Python] Re: Remove reference edits via Python?

2014-10-31 Thread Fredrik Averpil
Aaahhh... yes, that did work. Thank you! On Fri, Oct 31, 2014 at 5:13 PM, Eduardo Grana eduardo.gr...@gmail.com wrote: import maya.cmds as cmds for ref in cmds.ls(references=True): cmds.file(unloadReference=ref) cmds.file (cr=ref) # *cleanReference* -- You received this message because

[Maya-Python] Possible Maya bug: Loading editMB into Maya via cmds.file()

2014-10-31 Thread Fredrik Averpil
I think I found a bug in Maya. After having fiddled around with reference edits in a script, something broke and it is impossible to load an “editMB” file back into Maya using Python or MEL. See the example script below. Step 4 won't work. However, if you re-open the scene after having run this

Re: [Maya-Python][ANN] Pyblish 1.0 Alpha

2014-10-31 Thread Marcus Ottosson
Hi all, Frontend is live http://event.pyblish.com! Interact with it using it’s RESTful API https://github.com/pyblish/pyblish-event#api - GitHub Repo https://github.com/pyblish/pyblish-event - More Details https://github.com/abstractfactory/pyblish/issues/99#issuecomment-61304407

[Maya-Python] Get point position using Uv map

2014-10-31 Thread Jan
The following script gets you the world position from a random uv-coordinate of the selected object. I affraid I don't know what you mean with symmetry line. import maya.OpenMaya as om import maya.cmds as cmds import random def GetDagPath(nodeName): sel = om.MSelectionList()