How to control Camera Headlamp intensity through a script?

TugpsxTugpsx Posts: 496

Does anyone have an idea how to control camera light intensity or headlight using scripting?

I can use this to turn the headlamp on or off maybe an adjustment to find the headlamp intensity.

function HeadLampsF()
{
	var oCamera = Scene.findCamera("Camera");
	if( oCamera.length == 0 )
	var cameraF = (oCamera);
	var cpropF = oCamera.findProperty( "HeadlampMode" ); 
	if( cpropF )
	{
		cpropF.setValue( 2 ); //Auto = 0, On = 1, Off = 2;
		cpropF.getValue( );
	}
}

 

Post edited by Tugpsx on

Comments

  • TugpsxTugpsx Posts: 496
    edited September 2021

    Ok did a bit more digging and found that i could set the intensity value  by finding its property of "Headlamp Intensity" but noticed that it had no effect if headlamp set to auto so i may have to set headlamp to "ON" then adjust the intensity.

    Please correct me if i'm wrong.

     

    Post edited by Tugpsx on
  • TugpsxTugpsx Posts: 496

    So yet again it wasnt clear since my scene didnt update until i mouse ove so ill have to add a refresh 

    function HeadLampsF()
    {
    	var oCamera = Scene.findCamera("Camera");
    	if( oCamera.length == 0 )
    	var cameraF = (oCamera);
    
    	var cpropF = oCamera.findProperty( "Headlamp Intensity" ); //Headlamp Intensity
    	if( cpropF )
    	{
    		cpropF.setValue( 5 ); // For Headlamp Auto = 0, On = 1, Off = 2; for Intensity use integer
    		cpropF.getValue( );
    	}
    debug (cpropF.getValue);
    }

     

Sign In or Register to comment.