Solved Sliders in Python plugin

Hi,

I'm trying to learn how to write a Python plugin that generates a spline, using the examples you have on Github.
I'm basing it mostly on the "py-double_circle_r19" example.

One of the things I'm having issues with is with the custom controls.
I can add them, for example like this in the .res file:

		REAL PYROUNDRECT_HEIGHT { UNIT METER; MIN 0.0; }
		REAL PYROUNDRECT_WIDTH { UNIT METER; MIN 0.0; }

but they only have a text box, no slider. How do I add sliders to them?

Thank you.

Hello @filipst,

Welcome to the Plugin Café forum and the Cinema 4D development community, it is great to have you with us!

Getting Started

Before creating your next postings, we would recommend making yourself accustomed with our Forum and Support Guidelines, as they line out details about the Maxon SDK Group support procedures. Of special importance are:

About your First Question

As @chuanzhen absolutely rightly pointed out, you can find the list of available description element types on the corresponding documentation page: Description Resource. Please note that some parts of documentation are better available on C++ category even though also related to Python workflow.

Let me know if you have any further questions.

Cheers,
Ilia

MAXON SDK Specialist
developers.maxon.net

@filipst example:

REAL PYROUNDRECT_HEIGHT { UNIT METER; MIN 0.0; CUSTOMGUI REALSLIDER;}

50f1b826-6663-4e81-91c7-796588ba56b3-image.png

相信我,可以的!

Thank you, it works!

Another question if you don't mind. What's the best/recommended way to limit one of these values based on other values?
For example, like how the corner radius on the Rectangle spline that comes with C4D is limited by the width or height of the rectangle?
Where in the plugin would the code for this go?

Hello @filipst,

Welcome to the Plugin Café forum and the Cinema 4D development community, it is great to have you with us!

Getting Started

Before creating your next postings, we would recommend making yourself accustomed with our Forum and Support Guidelines, as they line out details about the Maxon SDK Group support procedures. Of special importance are:

About your First Question

As @chuanzhen absolutely rightly pointed out, you can find the list of available description element types on the corresponding documentation page: Description Resource. Please note that some parts of documentation are better available on C++ category even though also related to Python workflow.

Let me know if you have any further questions.

Cheers,
Ilia

MAXON SDK Specialist
developers.maxon.net

Hello @filipst,

Without further questions or updates we will consider this topic as solved by Friday the 11th, and flag it accordingly.

Cheers,
Maxon SDK Group

MAXON SDK Specialist
developers.maxon.net