[Closed] Getting IEPolyMod detach settings
Hi, everyone.
I need to know the state of Detach to Element and Detach as Clone checkboxes in Detach popup dialog without opening it.
After a bit of googling I found that epm_clone_to_element (index 63) is what I need, but for some reason it always returns 0.0
upd Seems like it has something to do with pdef.ID and for index 63 pdef.ID is 0. It is a pity
(
delete objects
obj = GeoSphere isSelected:on
addModifier obj (Edit_Poly())
max modify mode
g = (dotNetClass "Autodesk.Max.GlobalInterface").Instance
EPOLY_MOD_INTERFACE = g.Interface_ID.Create 0x405e217d 0x49c2abc
inode = g.COREInterface.GetINodeByHandle $.inode.handle
derivedObject = inode.objectref
modif = derivedObject.GetModifier 0
base = modif.getinterface EPOLY_MOD_INTERFACE asdotnetobject:true
pb2 = modif.GetParamBlock 0
interv = g.interval.create()
for i=0 to pb2.NumParams-1 do (
pdef = pb2.getparamdef i
val = 1.0
pb2.GetValue pdef.id g.COREInterface.Time &val interv 0
format "%-% - % value:%
" i pdef.id pdef.intname val
)
)
epm_clone_to_element is just a enum parameter. it’s not used in the code. there is no parameter in pblock that stores any of these settings. so you don’t a chance to get it by getting a param value.
i’m pretty sure that with debugger we can find an offset to these private params, but i don’t believe it’s a safe way to get them
In Max 2016 I get pdef.ID = 110 for i=63.
I have tryed many things without chance. In fact:
(pb2.GetParameterType 63).toString() returns “Unspecified”.
For other checkboxes you get “Bool2”. So it seems it’s not possible to get its value this way.
it’s hard to believe(!) but the system reads these values as like as:
epini = (getdir #plugcfg + @”\editpolymod.ini”)
getinisetting epini “EPolySettings” #DetachToObject
getinisetting epini “EPolySettings” #DetachAsClone
you can check… these parameters are not saved per file. they are common plugin’s settings which are changing every time you change them in any edit_poly plugin instance
the setting of the values is a little more complicated. you have to force loading ini settings by probably creating a new instance of edit_poly modifier… (it’s just my guess)
It turn out that suspendEditing helps to update the values when we in the modify mode. In create mode it works just fine.