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

2014-11-14 Thread Mark Jackson
So I'm going for the UUID idea, but going to reset it each time the node gets cached, that way when referencing files the minute that node hits the cache the UUID is updated and becomes unique regardless of referencing. Just the node duplicate issue which I'll use the callback mechanism, I was

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

2014-11-14 Thread Marcus Ottosson
The MAsset code I wrote Hi David, was this code you shared somewhere? Or to which code are you referring? ​ On 14 November 2014 09:55, Mark Jackson mark...@gmail.com wrote: So I'm going for the UUID idea, but going to reset it each time the node gets cached, that way when referencing files

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

2014-11-14 Thread David Moulder
It was a custom asset / reference system that I wrote a good few years back at Eurocom. At the time I wanted to use Maya asset system. I nearly used it, but found some killer bugs when duplicating assets. They basically kept loosing material assignments. Also as assets use the reference system

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

2014-11-13 Thread Marcus Ottosson
Was looking up on this too, and found some more discussion about it here (albeit from 2008). http://forums.cgsociety.org/archive/index.php/t-630763.html If I'm understanding your needs correctly, Mark, you're looking to uniquely, and immutably identify nodes in Maya? I'd like for this too, but it

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

2014-11-13 Thread Mark Jackson
Hi Marcus, thanks for the link, seems to re-enforce everything I've found so far, might ping the devs a mail, see if there's been any movement on this front in the api since that post. I've been digging too, and am still not satisfied with any of the solutions. MObjectHandles not being unque puts

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

2014-11-13 Thread David Moulder
Hi Mark and Marcus. The MAsset code I wrote managed uuids on duplicate callbacks. You could re-use / re-factor that. Worked throughout GoldenEye without any issues. Also the cool thing about that uuid was I could add several nodes to the same uuid and treat them as one MAsset, In effect

[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] 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