Gradient in PPG

52 views
Skip to first unread message

Mathias N

unread,
Jan 21, 2014, 5:13:34 PM1/21/14
to softimage
Evening

Would any of you happen to know how to add a gradient (siControlGradient) item to a PPG layout?

With any of the standard data types it is pretty straight forward: parameter, label, UI type.
A color item is given its own method, where instead of pointing to a single parameter you point to float parameter representing red and it handles the rest.

But how exactly does this function with gradients? By definition it cannot be linked to only a single parameter, but there is no special method for it like with color.

The docs would suggest that it is possible, but provides no information as to how. Blindly flinging arguments at it has gotten me nowhere.
http://download.autodesk.com/global/docs/softimage2014/en_us/sdkguide/si_om/siPPGControlType.html

Cheers

Matt Lind

unread,
Jan 21, 2014, 5:20:20 PM1/21/14
to soft...@listproc.autodesk.com

Gradients are intended for use with shader PPGs.

 

I’m tempted to say there was work done in the 2012 release to make them available for custom property/operator PPGs, but I cannot say for sure.  I do know there is a bug with some of the scripting languages for defining a gradient as siControlGradient (or whatever the enum is) doesn’t work.  You have to use the string ‘gradient’ instead.  Same issue applies to texture projection widget for choosing which texture projection to use.

 

Like with any other PPG Layout control, the parameter(s) the control is expected to drive must exist before it’ll appear on the PPG layout.  The gradient control expects at least 3 different scalars before it’ll draw.  One for position (_pos), another for the interpolant (_mid), and one for the value driven by the other two.  The gradient can accept up to 8 scalars for each.

 

 

 

Matt

Luc-Eric Rousseau

unread,
Jan 21, 2014, 6:07:53 PM1/21/14
to soft...@listproc.autodesk.com
you need to create an array of parameters with the right types and add
the control on the first parameter. So it's just like the color
widget.
Check the Gradient operator in the fxtree. Open its .spdl file to see
how it works.

it's something like, one integer for type, and 8 groups of rgb color
and a float for their position. something like that.

isn't the SDK documentation awesome.

Mathias N

unread,
Jan 22, 2014, 5:56:02 AM1/22/14
to softimage

isn't the SDK documentation awesome.
Impeccable (屮゚Д゚)屮

So, int for type, 8 groups pf RGB(A?), position float ...

Both the ICE gradient and the fxtree gradient have 16 colors though, with the former also having mid points in addition to the positions.

Do I have to set those? What about the number of markers?

Do I create an actual array of parameters and pass it, or just create a bunch of parameters and pass the first as with .AddColor?

The number of possible combinations to try without XSI giving you any real feedback boggles the mind.

julien carmagnac

unread,
Jan 22, 2014, 6:06:49 AM1/22/14
to soft...@listproc.autodesk.com
Hello,

I recently try the "AddProxyParameter" command with a gradient param in reference (from an ICE Compound), and it automatically crash Softimage (2014 SP2).

I probably may create a new gradient parameter to drive the ICE one.
So I'm very interested by your request because I found nothing in the doc.



2014/1/22 Mathias N <mdaw...@gmail.com>

Luc-Eric Rousseau

unread,
Jan 22, 2014, 1:03:52 PM1/22/14
to soft...@listproc.autodesk.com
Sorry, I checked into this further, and the Gradient control expects a
hierarchy of parameters (color.red, color.green, etc) and not flat
list. Creating hierarchy of parameters on a custom property has never
been exposed to the SDK, so you can't construct one, and therefore
could never use this widget in its current form

Daniel Brassard

unread,
Jan 22, 2014, 2:25:40 PM1/22/14
to softimage
Just a thought, how about using FCurves to drive the colors?

Eric Mootz

unread,
Jan 22, 2014, 2:39:27 PM1/22/14
to soft...@listproc.autodesk.com
Yep, that was my workaround a while ago after I discovered that gradients could not be used in PPGs.
It works, but three FCurves are rather "uncool" compared to a good ol'd gradient control. But it works.
 
Cheers,
Eric
 
 

julien carmagnac

unread,
Jan 22, 2014, 2:57:11 PM1/22/14
to soft...@listproc.autodesk.com
Bad news,
but thanks for the info.

FCurve may be ok but the fact that we don't visualise color isn't cool.

Anyway, on my side i will try to make my own representation, perhaps with the three FCurves too.

Cheers.


2014/1/22 Eric Mootz <er...@mootzoid.com>
Reply all
Reply to author
Forward
0 new messages