Quick question for a beginner about DzSpotLight property I'm hoping to find.

I'm a professional programmer, but I'm new to Daz scripting.

That being said, I've gone through a lot of documentation, and found out just about everything I need for a script I'm writing....except I can't find where you change the intensity of a light.

The part of my script where I'm making the lights is about like this:

for(i = 0;i<360;i++)<br /> {
if(i% 40 == 0)
{
var newLight = new DzSpotLight("Test");
var oNode = new DzNode();

var pos = new DzVec3(Math.cos(i) * 400, 90, Math.sin(i) * 400);
newLight.setPointAtTarget(myNode);
newLight.setLocalPos(pos);
Scene.addNode(newLight);
}
}


where it just makes some lights in a circle pointing at the myNode object, which is defined elsewhere, however, I want the lights to be really dim, but I can't find anywhere in documentation where it describes how to do this. Do you know where I could look for this?

Thanks!

Post edited by corranvh_585af5cf64 on

Comments

  • Richard HaseltineRichard Haseltine Posts: 100,886
    edited December 1969

    Try
    var intProp;
    ....
    intprop = newLight.findPropertyByLabel ( "Intensity" );
    if ( intProp ) {
    intProp.setValue( number );
    }

  • edited May 2015

    intProp = newLight.findPropertyByLabel ( “Intensity” );

    This line gives me a parse error.

    EDIT: Never mind, it's because I copied and pasted it, and the parser didn't like the double quotes in the pasted text.

    Post edited by corranvh_585af5cf64 on
  • edited December 1969

    Also, to set deep shadow maps, would I do something similar?

  • zaz777zaz777 Posts: 115
    edited May 2015

    The documentation for scripting isn't complete, but there are some things you can use to supplement it and eliminate most of the missing information.

    The DAZ Studio SDK is available for free in the store. Even though its really for C++ and writing plugins that will be compiled, I sometimes find useful bits of information in the docs that helps with scripting.

    Also, there are a lot of methods/functions available on the script objects that aren't documented in the available documentation. Rob posted a script, and several others made a few changes, that will print all the members of script objects, some of which might not be documented. You can find that script in this thread:

    http://www.daz3d.com/forums/discussion/37769/

    If you haven't found this yet, http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/start , there are some example scripts and raw information that you might find useful as well.

    Post edited by zaz777 on
Sign In or Register to comment.