PDA

View Full Version : Change pre-multipla alpha for TGA render jobs.


mustan9
05-29-2009, 05:02 AM
function send_render_job nameStr dateStr =
(
-- Get and then connect to the manager
mngr = NetRender.GetManager()
-- check if you are already connected
if mngr.connected == false do
(
-- connect to the manager if not already connected and force 32bit mode
--platform is an undocumented parameter used to connect to the manager
-- for access to 32bit or 64bit jobs. You can only connect to one at a time.
mngr.connect #automatic "255.255.255.0" platform:#32
)

dir = "\\\\Ripply\\render_output\\clients\\xxxx\\"+dateStr+"\\"+nameStr
file = dir+"\\"+nameStr+".tga"
makeDir dir all:true

-- Now that we have access to the manager we need to prepare the job for submission
job = mngr.newJob()
-- assign a name to the job
job.name = "Auto-"+nameStr+"-"+dateStr
-- From here you can set just about anything else you need.
job.includemaps = true -- set includemaps to true for the job
job.suspended = true
job.frameoutputname = file
job.fromFrame = 0
job.toFrame = animationRange.end
-- Once done setting your render parameters you need to simply submit the job
job.Submit()

-- disconnect
mngr.Disconnect()
)


Hi,

The above code works fine, except that the TGA sequences that are rendered have the wrong kind of alpha. I want to be able to turn on/off the pre-multiple alpha setting for saving TGA files, but I can't figure out how to do that.

Any ideas?

Thanks,

Jon-Huhn
05-29-2009, 12:10 PM
Try adding this:

Targa.setPreMultAlpha true

Or use false if you want premult off.

For a full description of all supported bitmap types and their properties, look up "BitmapIO" in the maxscript help. Good luck!

PiXeL_MoNKeY
05-29-2009, 01:10 PM
I have had various issues in the past where TGA values didn't set with the scene. You have 2 options 1) persistent filepostopen callback which sets the maxscript code for your tga settings or 2) submit using the 3dsmaxcmd setting the tga parameters as you submit it.

-Eric

MikeOwen
12-16-2009, 10:53 AM
Interesting. I have just encountered a tga setting not taking in MAXScript!
With the Render Scene Dialog closed...

In Max2009x64:

Targa.setColorDepth 32
results in "OK"

targa.itgaio.getcolordepth()
results in 16.

Brilliant! Is this fixed in Max2010/2011?

PiXeL_MoNKeY
12-16-2009, 03:54 PM
Not sure what your problem is, as it works fine here in 2009x64.targa.setcolordepth 16
targa.getcolordepth()
targa.itgaio.getcolordepth()
targa.setcolordepth 32
targa.getcolordepth()
targa.itgaio.getcolordepth()Returns this hereOK
16
16
OK
32
32-Eric

MikeOwen
12-16-2009, 04:07 PM
I'm so sorry, just re-read my post and it doesn't make sense!!!
What I meant to say is that the MAXScript setting is 'taken' and the result displayed is correct in the say, MAXScript listener window BUT, if you go and look at the actual render output filename under the Render Scene Dialog, file, settings, then it does not update to the new setting. This is the case even if the render scene dialog is closed when you make teh setting value change!

Hope this clarify's the issue!

Thanks,
Mike

PiXeL_MoNKeY
12-16-2009, 05:30 PM
My guess is the TGA render dialog settings are coming from the configuration file, and not what your setting through maxscript. However, if you render the file out it should be from what you are seeing in maxscript. I am sending off files using this just recently with PNG set through maxscript and a persistent filepostopen callback and everything saves correctly. I can't say why, but I do know that the maxscript and command-line approach has yet to fail me. Unlike setting it through the Render Dialog UI, where it has been hit or miss for me in the past.

-Eric

CGTalk Moderation
12-16-2009, 05:30 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.