3rd party customgui pointer

On 02/04/2017 at 14:51, xxxxxxxx wrote:

Is it possible to retrieve a customgui wich is not made by maxon? If not can it be considered as feature request?

basicly doing this stuff

            bc = c4d.BaseContainer()
            bc.SetReal(c4d.DESC_MIN, 0.0)
            bc.SetReal(c4d.DESC_MAX, 100.0)
            bc.SetReal(c4d.DESC_STEP, 0.01)
            bc.SetLong(c4d.DESC_UNIT, c4d.DESC_UNIT_FLOAT)
            CustomFloatSlider = self.AddCustomGui( 1001,  SLIDERGUI, "", c4d.BFH_SCALEFIT | c4d.BFV_SCALE,100,0,bc)
            self.SetReal(1001, 50.05, 10.0, 20.0, 0.00001, min2=0, max2=100)
            #Not working since CustomFloatSlider is a bool while a pointer to the gizmo is expected
            #CustomFloatSlider.SetReal(1001, 50.05, 10.0, 20.0, 0.00001, min2=0, max2=100)

Gedialog.FindCustomGui have a note about it but not addCustomGui.

BTW if it's not possible since this customGui is just a customGUi who display all float decimal (and it's why I wanna it into my plugin).
Is it possible to create a AddEditNumberArrows with a custom number of decimal? (I know ui can store all range of float but it only display 3decimal)

Thanks in advance :)

On 02/04/2017 at 23:24, xxxxxxxx wrote:

If i right understand you^ you need slider like this? or not? https://drive.google.com/open?id=0B6LsRuoqyxhTdlhGUTdTeFJzRUU

On 03/04/2017 at 00:42, xxxxxxxx wrote:

No since in your case as you can see it's just a slider with DESC_UNIT set to DESC_UNIT_METER.
Basicly I want the octane slider which is like that.

I have contacted them and they friendly share with me their c++ creation code.
And the only part I can't replicate it's to get/set value from this custom gui since I don't have a reference to the CustomGui

Maybe it can help but basicly they do this:

MyCustomFloatSlider *gui = (MyCustomFloatSlider * )AddCustomGui( ui_id, customGUi_id, String(), BFH_SCALEFIT|BFV_SCALE,100,0,bc);  
gui->setValue(value, minVvalue, maxVvalue, slMin, slMax, step);

And into this SetValue function they just do
SetReal(ui_id,(Real)val, minVvalue, maxVvalue, step);

But since in python the returned value of AddCustomGui is a bool and not an instance of c4d.gui.BaseCustomGui https://developers.maxon.net/docs/Cinema4DPythonSDK/html/modules/c4d.gui/BaseCustomGui/index.html
I can't doing SetValue.

On 03/04/2017 at 05:58, xxxxxxxx wrote:


I'm afraid that's a limitation of the Python API.
A 3rd party custom Gui can be added to a dialog but its actual object is not returned from AddCustomGui() or FindCustomGui().
In such case these functions only return True and that's not really helpful (there's no way to get/set the custom Gui data).
We are aware of this limitation and it's already in our Todo list.

Note: There are no pointers in Python :slightly_smiling_face:

On 03/04/2017 at 06:04, xxxxxxxx wrote:

Ok I was afraid of this kind of answerd. But thanks for taking time to answerd me.
I know it's more easy to say than to do but in feature release it would be nice to have at least the possibility to get the container of the CustomGUi.

Is there any way for displaying more than 3 decimal into a AddEditNumberArrows ?

Haha yeah looks like in a month of c++ I start to think only in c++. It's a great news for me.