The default behavior for an MPxNode is to only save when the value differs
from the default value or if there is an incoming connection. You can read
more about it in the MPxNode doc's. You can change the behavior by
overwriting the method:
om.MPxNode.shouldSave()

On Wed, Dec 6, 2017 at 1:11 PM, casf01 <[email protected]> wrote:

>
> I have this node that store an array of 2 double
>
>                 nAttr = om.MFnNumericAttribute()
>                myNode.points = nAttr.create("Points", "p", om.
> MFnNumericData.k2Double)
>              nAttr.storable = True
>           nAttr.readable = True
>           nAttr.array        = True
>               nAttr.writable = True
>           myNode.addAttribute(myNode.points)
>
>
> then when I do go in the node hit add a new item save my scene and re-open
> it, the array is empty but when I change the value to something else like
> (1.0, 0)and save it's fine and it my (1.0, 0 ) value is saved.
>
> It seems like an item with a default value won't save itself :/
>
> What can I do ?
>
> --
> 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 [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/python_inside_maya/1cf446d5-f832-4232-bb5e-
> 0d7c74f1ca45%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/1cf446d5-f832-4232-bb5e-0d7c74f1ca45%40googlegroups.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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAJAkR61vhpZYwmRKXcL2LU4TDuQPiXORfy%3DGszx-vW7AaLjMwg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to