Set Slider minimum programmatically [SOLVED]

On 23/04/2015 at 09:04, xxxxxxxx wrote:


in your code you are adding a parameter to the description and overwriting the existing BaseContainer with an (almost) default one; you are not editing an existing parameter.

To edit an existing parameter you have to access the BaseContainer with the information on that parameter. You do this with GetParameterI(). The SDK project contains several examples on how to use this function, like the Sculpt Deformer plugin.

Best wishes,

On 24/04/2015 at 05:33, xxxxxxxx wrote:


I've finally got it working, but the only problem is that my slider gets duplicated, which is not what I want.
I'm going to have a complex user interface, so doubling my sliders is bad.

Here is my code:

Bool MyPluginData::GetDDescription(GeListNode* node, Description* description, DESCFLAGS_DESC& flags)  
  if (!description->LoadDescription(node->GetType()))  
      return false;  
  const DescID* singleid = description->GetSingleDescID();  
  DescID cid = DescLevel(10002, DTYPE_REAL, 10000);  
  if (!singleid || cid.IsPartOf(*singleid, nullptr))  
        AutoAlloc<AtomArray> ar;  
        BaseContainer* bc = description->GetParameterI(DescLevel(10002), ar);  
        if (!bc)  
            return false;  
        } else {  
            bc->SetFloat(DESC_MIN, 8.0);  
        if (!description->SetParameter(cid, *bc, DescLevel(10000)))  
            return false;  
    return SUPER::GetDDescription(node, description, flags);  

Does somebody know how to fix this? How to not duplicate your sliders?

(For the people not reading my whole post: I've added my sliders inside my .res file, and I want to set the minimum value programmatically, so I can constrain it with other sliders)

Thanks for your help and time!!
Casimir Smets

On 24/04/2015 at 06:19, xxxxxxxx wrote:

Hi Casimir,
I think, you just need to delete the SetParameter() part, as you are not adding a new dynamic description, but just edit a part of an existing description and you retrieved the container instance via GetParameterI().

On 24/04/2015 at 07:03, xxxxxxxx wrote:

Hi Andreas,

It seems that you are right! 🙂
If I delete

if (!description->SetParameter(cid, *bc, DescLevel(10000)))  
  return false;  

I get my slider only once.

Thanks for your help, Andreas and Sebastian!!
Casimir Smets

On 27/04/2015 at 02:31, xxxxxxxx wrote:


I have 2 sliders, slider2 limits slider1's MIN value.
So if I make the value of my first slider lower, I can't get under the value of my second slider.
However, if I make the value of my second slider lower, the first slider sometimes follows, which I don't want. To be more clear, sometimes it follows to the exact value, sometimes to a different value than my second slider, but still different than the previous value; and sometimes it doesn't change, which is what I want.

I hope my problem is clear to you guys, if not, ask me some more questions!
Does anybody know what causes the problem here?

The code can be found on a previous post on this topic.
Thanks in advance for your help and time!

Casimir Smets

On 27/04/2015 at 03:22, xxxxxxxx wrote:

Check the SDK examples. You need to overload the Message member function and then check for the DESCRIPTION_VALIDATE message id. Then you can use CutReal() to limit one element value based on another. If you are already doing this some code is required to see what's wrong.

On 27/04/2015 at 05:36, xxxxxxxx wrote:

Hi Katachi,

It seems like you are my hero! 😄
This is exactly what I want, nothing more, nothing less! Thanks for your answer!

I'm confused and wondering why the moderators didn't show me this simple and effective method.
But still, you can mark this as closed!

For the other people having the same problem, I strongly recommend the way with Message: once again, because its so easy and effective.

Casimir Smets

On 27/04/2015 at 05:47, xxxxxxxx wrote:

They are all human and sometimes you simply don't think of every other way (spooking in the back of your head with so many other things), so cut the support some slack 😉 Glad it worked out fine for you.

On 27/04/2015 at 06:51, xxxxxxxx wrote:

Hi Casimir,

you need to give us some time to react... you asked the question with slider dependencies roughly four hours ago. And if Katachi hadn't been faster (thanks Katachi 🙂), you probably would have gotten a similar answer from us by now.
Please also always keep in mind, PluginCafe forum is not the only place we work on.
On our developer support site, we describe what we do and what not: About us
The support on PluginCafe is free and we try to keep our answer times below two workdays (which to me doesn't sound too bad for free support). And on average we are even a bit faster.

On 27/04/2015 at 07:00, xxxxxxxx wrote:

Oh, don't get me wrong, I'm not mad at them or something.
I just thought this to be a simple and standard way to do it. Clearly it's not that standard, I guess, that's all.
And I appreciate the time they put in helping me and others around here so much!! (This goes for everybody, moderators or users)
It also wasn't criticism, just a thought spooking in my head 😉

Thanks for your help guys!
Casimir Smets