Re: Controlling a parameter "live" via slider through scripting

2013-11-07 Thread Luc-Eric Rousseau
Hello,
assuming this is pretty much the script you wrote, aren't you just
setting the bevel value when InspectObj returns?
That command will only return after the user clicks OK on the dialog

On Tue, Nov 5, 2013 at 6:29 AM, 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


Re: Controlling a parameter "live" via slider through scripting

2013-11-07 Thread Eugen Sares
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 
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



Re: Controlling a parameter "live" via slider through scripting

2013-11-07 Thread 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 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







--
-
  Stefan Kubicek   ste...@keyvis.at
-
   keyvis digital imagery
  Alfred Feierfeilstraße 3
   A-2380 Perchtoldsdorf bei Wien
Phone:  +43 (0) 699 12614231
 www.keyvis.at
--   This email and its attachments are--
-- confidential and for the recipient only --



Re: Controlling a parameter "live" via slider through scripting

2013-11-07 Thread Christian Gotzinger
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 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
>
>


Re: Controlling a parameter "live" via slider through scripting

2013-11-06 Thread Benjamin Paschke
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



Re: Controlling a parameter "live" via slider through scripting

2013-11-06 Thread Christian Gotzinger
Thank you everyone for the additional tips!


On Wed, Nov 6, 2013 at 8:20 AM, Stefan Kubicek  wrote:

>  The cleanest way I suppose would be to have the PPG reside on the
> operator directly.
>
> Write a command to apply the op and display its PPG (points 1 and 2 in
> your list), then on the PPG there could be a button (calling a second
> command for instance) that freezes the object and performs your additional
> modeling operations (points 3 and 4).
>
> That's what I'd do. You could even create menu items for your command(s)
> and anchor them in one of the existing menus so you can call the
> operation(s) from there.
>
> Thank you for the links, I think these contain what I need.
>
> What would be the standard way for controlling operators? I'm not trying
> to do anything special, really just looking for the most straightforward
> way to:
> 1) Add a bevel operator
> 2) Allow the user to change settings of the bevel operator
> 3) Freeze the object
> 4) Perform additional modeling operations
>
> Step 2) is the only part where I need interactive user input. Once the
> user is happy and clicks OK, steps 3) and 4) must be automatically
> performed by the script.
>
>
> On Tue, Nov 5, 2013 at 1:12 PM, Stefan Kubicek wrote:
>
>> It is quite unusual to update operators based on another global PPG's
>> parameter I think, though theoretically it should work if the operator uses
>> the Property's relevant parameters as an input.
>>
>> Check out
>> http://download.autodesk.com/global/docs/softimage2014/en_us/sdkguide/si_om/CustomOperator.html
>>
>> and in particular:
>> http://download.autodesk.com/global/docs/softimage2014/en_us/sdkguide/si_om/CustomOperator.AddInputPort.html
>>
>>
>>
>> No, it's not Immediate Mode. After the PPG is closed, the operator values
>> update correctly. But they don't update when changing the slider value
>> while the PPG is open.
>> I will delete the custom property once the user closes the PPG, so I
>> think it's not too important where it's stored.
>>
>>
>> On Tue, Nov 5, 2013 at 12:37 PM, Stefan Kubicek 
>> wrote:
>>
>>> Could it be that you have immediate mode enabled?
>>> Also, why do you store the parameters in a global PPG in the SceneRoot
>>> rather than on the actual operator per object?
>>>
>>>
>>> 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
>>>
>>>
>>>
>>>
>>> --
>>> ---
>>> Stefan Kubicek
>>> ---
>>> keyvis digital imagery
>>> Alfred Feierfeilstraße 3
>>> A-2380 Perchtoldsdorf bei Wien
>>> Phone: +43/699/12614231
>>> www.keyvis.at ste...@keyvis.at
>>> -- This email and its attachments are --
>>> --confidential and for the recipient only--
>>>
>>
>>
>>
>>
>> --
>> ---
>> Stefan Kubicek
>> ---
>> keyvis digital imagery
>> Alfred Feierfeilstraße 3
>> A-2380 Perchtoldsdorf bei Wien
>> Phone: +43/699/12614231
>> www.keyvis.at ste...@keyvis.at
>> -- This email and its attachments are --
>> --confidential and for the recipient only--
>>
>
>
>
>
> --
> ---
> Stefan Kubicek
> ---
> keyvis digital imagery
> Alfred Feierfeilstraße 3
> A-2380 Perchtoldsdorf bei Wien
> Phone: +43/699/12614231
> www.keyvis.at ste...@keyvis.at
> -- This email and its attachments are --
> --confidential and for the recipient only--
>


Re: Controlling a parameter "live" via slider through scripting

2013-11-05 Thread Stefan Kubicek

The cleanest way I suppose would be to have the PPG reside on the operator directly.Write a command to apply the op and display its PPG (points 1 and 2 in your list), then on the PPG there could be a button (calling a second command for instance) that freezes the object and performs your additional modeling operations (points 3 and 4).That's what I'd do. You could even create menu items for your command(s) and anchor them in one of the existing menus so you can call the operation(s) from there.Thank you for the links, I think these contain what I need.What would be the standard way for controlling operators? I'm not trying to do anything special, really just looking for the most straightforward way to:
1) Add a bevel operator2) Allow the user to change settings of the bevel operator3) Freeze the object4) Perform additional modeling operationsStep 2) is the only part where I need interactive user input. Once the user is happy and clicks OK, steps 3) and 4) must be automatically performed by the script.
On Tue, Nov 5, 2013 at 1:12 PM, Stefan Kubicek  wrote:



It is quite unusual to update operators based on another global PPG's parameter I think, though theoretically it should work if the operator uses the Property's relevant parameters as an input. 
Check out http://download.autodesk.com/global/docs/softimage2014/en_us/sdkguide/si_om/CustomOperator.html
and in particular: http://download.autodesk.com/global/docs/softimage2014/en_us/sdkguide/si_om/CustomOperator.AddInputPort.html
No, it's not Immediate Mode. After the PPG is closed, the operator values update correctly. But they don't update when changing the slider value while the PPG is open.
I will delete the custom property once the user closes the PPG, so I think it's not too important where it's stored.
On Tue, Nov 5, 2013 at 12:37 PM, Stefan Kubicek  wrote:




Could it be that you have immediate mode enabled?Also, why do you store the parameters in a global PPG in the SceneRoot rather than on the actual operator per object?
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 generatedMyPSet = A.ActiveSceneRoot.AddProperty("CustomProperty", False, "Bevel_Options")


MyLayout = MyPSet.PPGLayoutMyPSet.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").ValueThank youChristian
-- ---   Stefan Kubicek---   keyvis digital imagery

  Alfred Feierfeilstraße 3   A-2380 Perchtoldsdorf bei Wien Phone:+43/699/12614231  www.keyvis.at  ste...@keyvis.at

--  This email and its attachments are   confidential and for the recipient only--
-- ---   Stefan Kubicek---   keyvis digital imagery  Alfred Feierfeilstraße 3
   A-2380 Perchtoldsdorf bei Wien Phone:+43/699/12614231  www.keyvis.at  ste...@keyvis.at
--  This email and its attachments are   confidential and for the recipient only--
-- ---   Stefan Kubicek---   keyvis digital imagery  Alfred Feierfeilstraße 3   A-2380 Perchtoldsdorf bei Wien Phone:+43/699/12614231  www.keyvis.at  ste...@keyvis.at--  This email and its attachments are   confidential and for the recipient only--

Re: Controlling a parameter "live" via slider through scripting

2013-11-05 Thread Martin Yara
I don't think it is that unusual. I used to use proxy parameters with
controls I used a lot and weren't easy to access, or were in different PPGs
around my scene, like camera roll and camera fov.

I first tried OnChanged with roll, but the update is a little slow. A proxy
parameter would be a better option if you want faster interactivity.
A CopyPaste Link between parameters should work too, but the proxy would be
cleaner.

Martin


On Tue, Nov 5, 2013 at 10:48 PM, Alok Gandhi wrote:

> Also take a look a proxy parameters. You can add proxy parameters from the
> operator to your custom PPG.
>
> Sent from my iPhone
>
> On Nov 5, 2013, at 7:30 AM, Christian Gotzinger 
> wrote:
>
> Thank you for the links, I think these contain what I need.
>
> What would be the standard way for controlling operators? I'm not trying
> to do anything special, really just looking for the most straightforward
> way to:
> 1) Add a bevel operator
> 2) Allow the user to change settings of the bevel operator
> 3) Freeze the object
> 4) Perform additional modeling operations
>
> Step 2) is the only part where I need interactive user input. Once the
> user is happy and clicks OK, steps 3) and 4) must be automatically
> performed by the script.
>
>
> On Tue, Nov 5, 2013 at 1:12 PM, Stefan Kubicek wrote:
>
>>  It is quite unusual to update operators based on another global PPG's
>> parameter I think, though theoretically it should work if the operator uses
>> the Property's relevant parameters as an input.
>>
>> Check out
>> http://download.autodesk.com/global/docs/softimage2014/en_us/sdkguide/si_om/CustomOperator.html
>>
>> and in particular:
>> http://download.autodesk.com/global/docs/softimage2014/en_us/sdkguide/si_om/CustomOperator.AddInputPort.html
>>
>>
>>
>> No, it's not Immediate Mode. After the PPG is closed, the operator values
>> update correctly. But they don't update when changing the slider value
>> while the PPG is open.
>> I will delete the custom property once the user closes the PPG, so I
>> think it's not too important where it's stored.
>>
>>
>> On Tue, Nov 5, 2013 at 12:37 PM, Stefan Kubicek 
>> wrote:
>>
>>> Could it be that you have immediate mode enabled?
>>> Also, why do you store the parameters in a global PPG in the SceneRoot
>>> rather than on the actual operator per object?
>>>
>>>
>>> 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
>>>
>>>
>>>
>>>
>>> --
>>> ---
>>> Stefan Kubicek
>>> ---
>>> keyvis digital imagery
>>> Alfred Feierfeilstraße 3
>>> A-2380 Perchtoldsdorf bei Wien
>>> Phone: +43/699/12614231
>>> www.keyvis.at ste...@keyvis.at
>>> -- This email and its attachments are --
>>> --confidential and for the recipient only--
>>>
>>
>>
>>
>>
>> --
>> ---
>> Stefan Kubicek
>> ---
>> keyvis digital imagery
>> Alfred Feierfeilstraße 3
>> A-2380 Perchtoldsdorf bei Wien
>> Phone: +43/699/12614231
>> www.keyvis.at ste...@keyvis.at
>> -- This email and its attachments are --
>> --confidential and for the recipient only--
>>
>
>


Re: Controlling a parameter "live" via slider through scripting

2013-11-05 Thread Alok Gandhi
Also take a look a proxy parameters. You can add proxy parameters from the 
operator to your custom PPG. 

Sent from my iPhone

> On Nov 5, 2013, at 7:30 AM, Christian Gotzinger  wrote:
> 
> Thank you for the links, I think these contain what I need.
> 
> What would be the standard way for controlling operators? I'm not trying to 
> do anything special, really just looking for the most straightforward way to:
> 1) Add a bevel operator
> 2) Allow the user to change settings of the bevel operator
> 3) Freeze the object
> 4) Perform additional modeling operations
> 
> Step 2) is the only part where I need interactive user input. Once the user 
> is happy and clicks OK, steps 3) and 4) must be automatically performed by 
> the script.
> 
> 
>> On Tue, Nov 5, 2013 at 1:12 PM, Stefan Kubicek  
>> wrote:
>> It is quite unusual to update operators based on another global PPG's 
>> parameter I think, though theoretically it should work if the operator uses 
>> the Property's relevant parameters as an input. 
>> 
>> Check out 
>> http://download.autodesk.com/global/docs/softimage2014/en_us/sdkguide/si_om/CustomOperator.html
>> 
>> and in particular: 
>> http://download.autodesk.com/global/docs/softimage2014/en_us/sdkguide/si_om/CustomOperator.AddInputPort.html
>> 
>> 
>> 
>> No, it's not Immediate Mode. After the PPG is closed, the operator values 
>> update correctly. But they don't update when changing the slider value while 
>> the PPG is open.
>> I will delete the custom property once the user closes the PPG, so I think 
>> it's not too important where it's stored.
>> 
>> 
>>> On Tue, Nov 5, 2013 at 12:37 PM, Stefan Kubicek  
>>> wrote:
>>> Could it be that you have immediate mode enabled?
>>> Also, why do you store the parameters in a global PPG in the SceneRoot 
>>> rather than on the actual operator per object?
>>> 
>>> 
>>> 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
>>> 
>>> 
>>> 
>>> --
>>> ---
>>> Stefan Kubicek
>>> ---
>>> keyvis digital imagery
>>> Alfred Feierfeilstraße 3
>>> A-2380 Perchtoldsdorf bei Wien
>>> Phone: +43/699/12614231
>>> www.keyvis.at ste...@keyvis.at
>>> -- This email and its attachments are --
>>> --confidential and for the recipient only--
>> 
>> 
>> 
>> 
>> --
>> ---
>> Stefan Kubicek
>> ---
>> keyvis digital imagery
>> Alfred Feierfeilstraße 3
>> A-2380 Perchtoldsdorf bei Wien
>> Phone: +43/699/12614231
>> www.keyvis.at ste...@keyvis.at
>> -- This email and its attachments are --
>> --confidential and for the recipient only--
> 


Re: Controlling a parameter "live" via slider through scripting

2013-11-05 Thread Christian Gotzinger
Thank you for the links, I think these contain what I need.

What would be the standard way for controlling operators? I'm not trying to
do anything special, really just looking for the most straightforward way
to:
1) Add a bevel operator
2) Allow the user to change settings of the bevel operator
3) Freeze the object
4) Perform additional modeling operations

Step 2) is the only part where I need interactive user input. Once the user
is happy and clicks OK, steps 3) and 4) must be automatically performed by
the script.


On Tue, Nov 5, 2013 at 1:12 PM, Stefan Kubicek  wrote:

>  It is quite unusual to update operators based on another global PPG's
> parameter I think, though theoretically it should work if the operator uses
> the Property's relevant parameters as an input.
>
> Check out
> http://download.autodesk.com/global/docs/softimage2014/en_us/sdkguide/si_om/CustomOperator.html
>
> and in particular:
> http://download.autodesk.com/global/docs/softimage2014/en_us/sdkguide/si_om/CustomOperator.AddInputPort.html
>
>
>
> No, it's not Immediate Mode. After the PPG is closed, the operator values
> update correctly. But they don't update when changing the slider value
> while the PPG is open.
> I will delete the custom property once the user closes the PPG, so I think
> it's not too important where it's stored.
>
>
> On Tue, Nov 5, 2013 at 12:37 PM, Stefan Kubicek wrote:
>
>> Could it be that you have immediate mode enabled?
>> Also, why do you store the parameters in a global PPG in the SceneRoot
>> rather than on the actual operator per object?
>>
>>
>> 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
>>
>>
>>
>>
>> --
>> ---
>> Stefan Kubicek
>> ---
>> keyvis digital imagery
>> Alfred Feierfeilstraße 3
>> A-2380 Perchtoldsdorf bei Wien
>> Phone: +43/699/12614231
>> www.keyvis.at ste...@keyvis.at
>> -- This email and its attachments are --
>> --confidential and for the recipient only--
>>
>
>
>
>
> --
> ---
> Stefan Kubicek
> ---
> keyvis digital imagery
> Alfred Feierfeilstraße 3
> A-2380 Perchtoldsdorf bei Wien
> Phone: +43/699/12614231
> www.keyvis.at ste...@keyvis.at
> -- This email and its attachments are --
> --confidential and for the recipient only--
>


Re: Controlling a parameter "live" via slider through scripting

2013-11-05 Thread Stefan Kubicek

It is quite unusual to update operators based on another global PPG's parameter I think, though theoretically it should work if the operator uses the Property's relevant parameters as an input. Check out http://download.autodesk.com/global/docs/softimage2014/en_us/sdkguide/si_om/CustomOperator.htmland in particular: http://download.autodesk.com/global/docs/softimage2014/en_us/sdkguide/si_om/CustomOperator.AddInputPort.htmlNo, it's not Immediate Mode. After the PPG is closed, the operator values update correctly. But they don't update when changing the slider value while the PPG is open.I will delete the custom property once the user closes the PPG, so I think it's not too important where it's stored.
On Tue, Nov 5, 2013 at 12:37 PM, Stefan Kubicek  wrote:



Could it be that you have immediate mode enabled?Also, why do you store the parameters in a global PPG in the SceneRoot rather than on the actual operator per object?
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 generatedMyPSet = A.ActiveSceneRoot.AddProperty("CustomProperty", False, "Bevel_Options")

MyLayout = MyPSet.PPGLayoutMyPSet.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").ValueThank youChristian
-- ---   Stefan Kubicek---   keyvis digital imagery
  Alfred Feierfeilstraße 3   A-2380 Perchtoldsdorf bei Wien Phone:+43/699/12614231  www.keyvis.at  ste...@keyvis.at
--  This email and its attachments are   confidential and for the recipient only--
-- ---   Stefan Kubicek---   keyvis digital imagery  Alfred Feierfeilstraße 3   A-2380 Perchtoldsdorf bei Wien Phone:+43/699/12614231  www.keyvis.at  ste...@keyvis.at--  This email and its attachments are   confidential and for the recipient only--

Re: Controlling a parameter "live" via slider through scripting

2013-11-05 Thread Christian Gotzinger
No, it's not Immediate Mode. After the PPG is closed, the operator values
update correctly. But they don't update when changing the slider value
while the PPG is open.
I will delete the custom property once the user closes the PPG, so I think
it's not too important where it's stored.


On Tue, Nov 5, 2013 at 12:37 PM, Stefan Kubicek wrote:

>  Could it be that you have immediate mode enabled?
> Also, why do you store the parameters in a global PPG in the SceneRoot
> rather than on the actual operator per object?
>
>
> 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
>
>
>
>
> --
> ---
> Stefan Kubicek
> ---
> keyvis digital imagery
> Alfred Feierfeilstraße 3
> A-2380 Perchtoldsdorf bei Wien
> Phone: +43/699/12614231
> www.keyvis.at ste...@keyvis.at
> -- This email and its attachments are --
> --confidential and for the recipient only--
>


Re: Controlling a parameter "live" via slider through scripting

2013-11-05 Thread Christian Gotzinger
I may be doing it wrong because I've never used this, but I don't seem to
be able to access the operator by doing this? The operator is defined
outside the injected script.


On Tue, Nov 5, 2013 at 12:37 PM, gareth bell  wrote:

> I think you need some PPG.Logic
>
>
> http://usa.autodesk.com/adsk/servlet/ps/dl/item?siteID=123112&id=14003709&linkID=12544120
>
> using an _OnChanged callback
>
>
>
>
> --
> Date: Tue, 5 Nov 2013 12:29:57 +0100
> Subject: Controlling a parameter "live" via slider through scripting
> From: cgo...@googlemail.com
> To: softimage@listproc.autodesk.com
>
>
> 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
>


Re: Controlling a parameter "live" via slider through scripting

2013-11-05 Thread Stefan Kubicek

Could it be that you have immediate mode enabled?Also, why do you store the parameters in a global PPG in the SceneRoot rather than on the actual operator per object?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 generatedMyPSet = A.ActiveSceneRoot.AddProperty("CustomProperty", False, "Bevel_Options")
MyLayout = MyPSet.PPGLayoutMyPSet.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").ValueThank youChristian
-- ---   Stefan Kubicek---   keyvis digital imagery  Alfred Feierfeilstraße 3   A-2380 Perchtoldsdorf bei Wien Phone:+43/699/12614231  www.keyvis.at  ste...@keyvis.at--  This email and its attachments are   confidential and for the recipient only--

RE: Controlling a parameter "live" via slider through scripting

2013-11-05 Thread gareth bell
I think you need some PPG.Logic

http://usa.autodesk.com/adsk/servlet/ps/dl/item?siteID=123112&id=14003709&linkID=12544120

using an _OnChanged callback



Date: Tue, 5 Nov 2013 12:29:57 +0100
Subject: Controlling a parameter "live" via slider through scripting
From: cgo...@googlemail.com
To: softimage@listproc.autodesk.com

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