Gradient in GetDDescription()
-
On 21/06/2015 at 22:04, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 15+
Platform: Windows ;
Language(s) : C++ ;---------
I'm creating a greadient inside GetDDescription()cid = DescLevel(ids, CUSTOMDATATYPE_GRADIENT, 0); if (!singleid || cid.IsPartOf(*singleid, nullptr))// important to check for speedup c4d! { BaseContainer dt = GetCustomDataTypeDefault(CUSTOMDATATYPE_GRADIENT); std::string dName = kndData->nodes[kndData->selectedNode].getInternalDataName(i); String dtName(dName.c_str()); dt.SetString(DESC_SHORT_NAME, dtName); dt.SetString(DESC_NAME, dtName); dt.SetBool(DESC_ANIMATE, DESC_ANIMATE_ON); dt.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_GRADIENT); if (!description->SetParameter(cid, dt, DescLevel(Tbaselist2d))) return true; }
I know that I can set GRADIENT_MODE to GRADIENTMODE_COLORALPHA, my questions are:
1- when I create the gradient, it doesn't show the "arrow" on the left, which expands gradient data when user selects knots.I create gradient like this:
GeData rampData(CUSTOMDATATYPE_GRADIENT, DEFAULTVALUE); Gradient *ramp = (Gradient* )rampData.GetCustomDataType(CUSTOMDATATYPE_GRADIENT);
and I can access RGB at any pos on the gradient using ::CalcGradientPixel(pos)
so second question is:
2- how to let user specify alpha for knots?, and how to create/retrieve this alpha data? -
On 29/06/2015 at 06:02, xxxxxxxx wrote:
Hello,
using your code I have no problems creating a Gradient parameter description with the arrow to expend the GUI.
If you are using a gradient with mode GRADIENTMODE_COLORALPHA you can access the alpha gradient using GetAlphaGradient(). To allow the user to edit the alpha gradient you must configure the custom GUI by setting GRADIENTPROPERTY_ALPHA to true in the above code.
Best wishes,
Sebastian -
On 29/06/2015 at 20:15, xxxxxxxx wrote:
here it doesn't show the arrow!!, is it related to Set/GetDParameter()? "as all the paramters are changing together also"
similar problem here, https://developers.maxon.net/forum/topic/8858/11705_getsetdparameter--customdatatypespline-solved
-
On 30/06/2015 at 02:31, xxxxxxxx wrote:
Hello,
sorry, I still cannot reproduce the issue. Please provide more code or information. What exactly do you mean with "as all the paramters are changing together also"?
best wishes,
Sebastian -
On 30/06/2015 at 10:00, xxxxxxxx wrote:
Hi Sebastian,
here is a video of all problems together,
https://www.dropbox.com/s/za8qpu8emr1kbch/SevenPhotons PluginProblems.mp4?dl=0first part: matpreview problem, using 1 of the matpreview scenes, and then an empty scene.
second part:gradient problem "all sub channels are changed together"
third part: spline gui problem "similar problem to gradient, animation doesn't work"
fourth part: gradient animation problem, shown subchannels. -
On 30/06/2015 at 10:09, xxxxxxxx wrote:
Hello,
you didn't tell us that you want to create the Gradient in the Material Editor and not in the Attribute Manager. Is there any other information that could be necessary to understand your situation?
Best wishes,
Sebastian -
On 30/06/2015 at 10:32, xxxxxxxx wrote:
nope, all the descriptions are created dynamically in GetDDescription of the MaterialData plugin.
some complex descriptions "that got sub channels" are making problems with Set/GetDParameter() "solved the simple case with Vector, but need to know sub channel IDs for spline customgui and gradient customgui". -
On 01/07/2015 at 03:08, xxxxxxxx wrote:
Hello,
the Material Editor is not the Attribute Manager. The toggle button to switch between the normal and maximized layout of a GUI is created by the Attribute Manager but not for the left column of the Material Editor. Also it seems that the state of the layout cannot be forced. I suggest to add this Gradient GUI to the "right" side of the Material Editor GUI.
Best wishes,
Sebastian -
On 01/07/2015 at 08:06, xxxxxxxx wrote:
ok, it seems to work on the "right" , so I will re design the whole thing.
what about other questions "matpreview problem, gradient and curver customgui Get/SetDParameter()"thanks a lot for the help Sebastian
-
On 02/07/2015 at 01:34, xxxxxxxx wrote:
Hello,
for questions no longer related to this thread's original topic please open a new thread. Thanks.
Best wishes,
Sebastian -
On 02/07/2015 at 05:07, xxxxxxxx wrote:
sure, other threads are already open.
-
On 02/07/2015 at 09:38, xxxxxxxx wrote:
any possible way to add this arrow when Gradient is created on the "left" area?