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 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 factory class and speeds things up considerably.
>
> However, reading through the docs it seems that the hashID isn't actually
> unique, from the api docs:
>
> *"The returned hash code is not unique: several internal Maya objects may
> return the same code. However different MObjectHandles whose MObjects refer
> to the same internal Maya object will return the same hash code."*
>
> Can anybody shed any light on this, am I barking up the wrong tree here?
>
> cheers
>
> Mark
>
> -------------------------------------
> Mark Jackson
> CEO / Technical Director
> red9consultancy.com
>
> --
> 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/CAGQH2FFG-jF%3DO6qtyPxwWp5jno%3DCk%3D5cJie9uaro7RpoC7p_SA%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAGQH2FFG-jF%3DO6qtyPxwWp5jno%3DCk%3D5cJie9uaro7RpoC7p_SA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAPGFgA32wgr0QdR7bVe0Z2Uv4yF0TfXhez9gnr_pdVS0NtxVzQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to