0

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 ?

widgg
  • 1,358
  • 2
  • 16
  • 35
  • asking just out of curiousity , you're using softimage api? . why do you need to deal with api when you can do things in software directly? – Mr.Anubis Aug 07 '12 at 18:33
  • Yep!! and it's not as Feng Shui as the one in Maya! Personally, I think my logic is good and it should work, but apparently, it was not design to be simple and logical! – widgg Aug 07 '12 at 18:35
  • because we're doing a plugin...! – widgg Aug 07 '12 at 18:35
  • what this string "LightName.point.soft_light.atten" is?, I mean what's lightname , point etc? can I see ref ? – Mr.Anubis Aug 07 '12 at 19:00
  • LightName... is the name of the object!... I tried to find any good references, but I don't find any... but, if I understood correctly, ".point" mean that I'm accessing this object as a light. ".LightExponent" is extracting the value of the light exponent! There's a section called "soft_light" and in it, there's the attenuation value called "atten". – widgg Aug 07 '12 at 19:20

1 Answers1

0

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.

widgg
  • 1,358
  • 2
  • 16
  • 35