i want to use EditSlider in my script to control weight, range (0.00 - 1.00) or other .i search in SDK and use "GeDialog.AddEditSlider(id, flags, initw=80, inith=0)",how can i change the range and get float just like set "user data"?
Hi @mike, first of all I would like to remind you to read and use the Q&A functionnality.
Regarding your question, here is an example of a basic GeDialog, which make use to SetFloat to define a range.
class MonDlg( c4d.gui.GeDialog):
idSlider = 1000
idButton = 1001
# Create the Layout
self.AddEditSlider(self.idSlider, c4d.BFH_SCALE|c4d.BFV_SCALE, initw=100, inith=20)
self.AddButton(self.idButton, c4d.BFH_SCALE|c4d.BFV_SCALE, initw=100, inith=20,name = 'Get Value')
# Called after CreateLayout
self.SetFloat(self.idSlider, 0.25, min=0.0, max=1.0, step=0.01, min2=0.0, max2=0.0)
# Called for each interaction from a widget
def Command(self, id, msg):
if id == self.idButton:
dlg = MonDlg()
If you have any questions please let me know.
@m_adam Thank you for your help!
Hi, @mike if the previous post solves your issue, please mark it as the correct answers. It will switch the topic as solved. To do so please read Q&A functionality.
Of course, if you didn't test my previous post, or may have follow-up questions, do not mark as solved and take as much time as you need to ask us. But if there is nothing more to add please mark your topic as solved.