// Get the image managervar oImageMgr = App.getImageMgr();// Define the desired gammavar nGamma = 2.2;// Get or create a DzTexture for the image; set gamma if createdvar oTexture = oImageMgr.getImage( "Absolute/path/to/image.ext", nGamma );// If we have a texture and its gamma is not the gamma we wantif( oTexture && oTexture.getGamma() != nGamma ){ // Set its gamma to the desired value oTexture.setGamma( nGamma );}
// Get the image manager
var oImageMgr = App.getImageMgr();
// Define the desired gamma
var nGamma = 2.2;
// Get or create a DzTexture for the image; set gamma if created
var oTexture = oImageMgr.getImage( "Absolute/path/to/image.ext", nGamma );
// If we have a texture and its gamma is not the gamma we want
if( oTexture && oTexture.getGamma() != nGamma ){
// Set its gamma to the desired value
oTexture.setGamma( nGamma );
}
Is there a way to check a particular node for diffuse textures that aren't at 2.2? This is probably a basic question but I'll ask since I'm new to Daz Scripting.
// Get the image managervar oImageMgr = App.getImageMgr();// Define the desired gammavar nGamma = 2.2;// Get or create a DzTexture for the image; set gamma if createdvar oTexture = oImageMgr.getImage( "Absolute/path/to/image.ext", nGamma );// If we have a texture and its gamma is not the gamma we wantif( oTexture && oTexture.getGamma() != nGamma ){ // Set its gamma to the desired value oTexture.setGamma( nGamma );}
-Rob
But how do you know which channel to set the gamma value? If you want only the Base Color? Or if you want only the Translucency Color?
// Get the image managervar oImageMgr = App.getImageMgr();// Define the desired gammavar nGamma = 2.2;// Get or create a DzTexture for the image; set gamma if createdvar oTexture = oImageMgr.getImage( "Absolute/path/to/image.ext", nGamma );// If we have a texture and its gamma is not the gamma we wantif( oTexture && oTexture.getGamma() != nGamma ){ // Set its gamma to the desired value oTexture.setGamma( nGamma );}
-Rob
But how do you know which channel to set the gamma value? If you want only the Base Color? Or if you want only the Translucency Color?
Thnx Rob
You'd get the image from the property, then use Rob's code to get its gamma.
Comments
-Rob
Thank you very much. :D
Is there a way to check a particular node for diffuse textures that aren't at 2.2? This is probably a basic question but I'll ask since I'm new to Daz Scripting.
Once you have the map oTexture.getGamma() will get the gamma. For getting the maps, see http://www.daz3d.com/forums/discussion/57229/
But how do you know which channel to set the gamma value? If you want only the Base Color? Or if you want only the Translucency Color?
Thnx Rob
You'd get the image from the property, then use Rob's code to get its gamma.