Actually, the operator changes done in a modal PPG can and should be reflected in the scene (try creating any primitive in immed mode). The only difference is that the stack gets frozen, well, immediately after you click ok or cancel.

If you want to have this behavior in your custom operator, I found that it works well if your parameter callbacks look like this:

function OpXY_paramXY_OnChanged()
{
var operationMode = Preferences.GetPreferenceValue("xsiprivate_unclassified.OperationMode");
    if(operationMode == siImmediateOperation)
        DelayedRefresh();
}




Am 07.11.2013 12:20, schrieb Stefan Kubicek:
That's why i was asking whether immediate mode is activated . Usually, modal PPGs pop up when immediate mode is turned on, so the user cannot make additional changes while the node change is still pending (the operation has not been completed by committing the operator to the stack and have it automatically collapsed/frozen). If I remember correctly, for custom ops, this must be done manually by opening the PPG in modal mode, but I believe to remember that it doesn't do real time updates like the factory ops do.



Oh wow, thank you so much for pointing this out! It all makes sense now.


On Thu, Nov 7, 2013 at 2:59 AM, Benjamin Paschke <ben.pasc...@rsp.com.au>wrote:

I don't think anyone has mentioned this yet, but I think it's because
you are inspecting the PPG in siModal mode.
siModal will give you a box to say OK or Cancel, but yes, changes are
not reflected live in the scene. This is what modal means.

On 05/11/13 21:59, Christian Gotzinger wrote:
> Hi list,
>
> My script generates a bevel operator on an object. I then want a PPG
> to pop up that allows the user to change certain parameters of the
> bevel operator. These parameters should update whenever the values in
> the PPG are changed. However, they only update after the PPG is closed
> via OK. Can someone point me in the right direction here?
>
> Script is roughly as follows:
>
> # Lots of stuff after which a bevel operator (op) is generated
> MyPSet = A.ActiveSceneRoot.AddProperty("CustomProperty", False,
> "Bevel_Options")
> MyLayout = MyPSet.PPGLayout
> MyPSet.AddParameter3("PBevelRatio", c.siFloat, 10, 0.01, 100)
> MySlider = MyLayout.AddItem("PBevelRatio", "Ratio", c.siControlNumber)
>
> A.InspectObj(MyPSet, "", "Choose Bevel Options", c.siModal, False)
>
> op.Parameters("ratio").Value = MyPSet.Parameters("PBevelRatio").Value
>
>
> Thank you
> Christian







---
Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz 
ist aktiv.
http://www.avast.com

Reply via email to