Getting IEPolyMod detach settings

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Display Modes
  06 June 2018
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:%\n" i pdef.id pdef.intname val
)
)

Last edited by Serejah : 06 June 2018 at 02:28 PM.
 
  06 June 2018
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.
__________________
Andrés FC.
P3D_PathScripts
 
  06 June 2018
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
 
  06 June 2018
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   
 
  06 June 2018
Originally Posted by Serejah: 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

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
 
  06 June 2018
Originally Posted by denisT: 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
Wow. How could I miss that.
Thank you, Denis
 
  06 June 2018
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) 
 
  06 June 2018
It turn out that suspendEditing helps to update the values when we in the modify mode. In create mode it works just fine.
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:43 PM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.