Question

I'm a bit desperate here... I'm trying to access one parameter of a light in Softimage.

First, when we do this:

light.GetParameterValue(L"LightExponent")

it works!

But when we try:

light.GetParameterValue(L"soft_light.atten")

it fails completely!

I tried to find documentation, but the only code that I could find is in Python and no indication for the equivalent in C++. In python, they manage to do something like:

xsi = Application
test = xsi.GetValue("LightName.point.soft_light.atten")

But I cannot figure out what is Application, and it's not the same as XSI::Application in the API.

So, any idea how to access this value ? Also, if I could found the equivalent to Application.GetValue (in the script, you can see Application.SetValue... so I imagine that GetValue exists in some form!) in C++, that would be nice... I could simply use the name of the light and then add the information that I need to access that value like:

SomeUnknownClassForNow::GetValue(light.GetName() + ".point.soft_light.atten");

Any idea ?

Was it helpful?

Solution

With the help of a client of ours, I finally managed to find a proper solution to this.

First, there's some direct parameters, like "LightExponent". But there's other parameters associated with an object, like a light, in other categories called Shaders.

With a light, or a least a point light, there's only one Shader, called "soft_light". It's possible to access it by:

light.GetShaders()[0]

It's possible to verify its name to with GetName(). Which, in this case, would be "LightName.point.soft_light".

Finally, to access the "soft_light.atten" parameter:

light.GetShaders()[0].GetParameterValue("atten")

So, in Softimage, there's sort of Hierarchy in objects and all these a separated as shaders. For more complex object, just find the right shader and extract its parameter.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top