3dsmax 2015 python, access modifiers of a reference clone

Hello,

I have two teapots, teapot_A and teapot_B, cloned by reference.
They have a shared point_cache modifier, and one of them has an individual smoothing modifier.

I want to check in python if these objects have a point_cache modifier or not.

Maxscript eval :

$teapot_B.modifiers.count
2

However, in Python, if I do this (assuming that teapot_b is my current selection)


mod_count = MaxPlus.SelectionManager.GetNode(0).GetNumModifiers()
#mod_count is 1, not 2, and is the individual smoothing modifier.

How can I have access to the clones “shared” modifiers ?

I could write this one-line mxs eval, but I’d really like to avoid that :slight_smile:

MaxPlus.Core.EvalMAXScript("(maxops.getNodeByHandle %d).modifiers[#point_cache] != undefined " % node_handle).GetBool()

Got it. Just for the record.


ref = MaxPlus.SelectionManager.GetNode(0).GetDerivedObject().GetObjRef()
o = MaxPlus.IDerivedObject._CastFrom(ref)
print o.GetModifier(0)

Result in listener :

OK
Animatable(Point Cache)
#success