Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Writing EXR HDR values with bitmap IO functions

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
347 Views, 2 Replies

Writing EXR HDR values with bitmap IO functions

I'm attempting to store hdr values in a EXR file. When opened in photoshop, the values clamp between 0-1. Does anyone know how to store a signed 16 bit exr files via maxscript? I tried colors, float3s and float4s. It doesn't seem to affect the outcome.

Any tips would be greatly appreciated

 

 

global ImageArray=#()
	tempArray=#()
	for j=0 to 15 do (
		append tempArray ([700, 100, 0, 15])--(color 153 228 184)
	)
	for i =0 to 15 do (
		append ImageArray tempArray
	)
 
	fopenexr.SetCompression 0 -- uncompressed
	fopenexr.setLayerOutputType 0 1 -- set layer 0  main layer to RGB
	fopenexr.setLayerOutputFormat 0 1 -- sets main layer to float 16 via 1. other options are 0 float 32, 2 int 32 
 
	TextureName = getSaveFileName types:"EXR (*.EXR)|*.EXR"
	FinalTexture = bitmap (ImageArray.count) (ImageArray.count) filename:TextureName;
	for i=0 to (ImageArray.count-1) do (
		setPixels FinalTexture [0, i] ImageArray[i+1]
		print ImageArray[i+1]
	)
 
	save FinalTexture
	close FinalTexture

2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

You need hdr:true when making the bitmap object.
FinalTexture = bitmap (ImageArray.count) (ImageArray.count) filename:TextureName hdr:true ;
Message 3 of 3
Anonymous
in reply to: Anonymous

Awesome! Thanks so much 😄

 

Now I can finish writting the script. Haha - it's kind of funny that I missed that requirement. 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report