Page 1 of 1

custom alphas via maxscript?

Posted: Mon Dec 09, 2013 7:31 pm
by egmehl
Is there a way to get / set the custom alphas for an object via maxscript? That would be a super helpful feature to add if not already there.

- Eric

Re: custom alphas via maxscript?

Posted: Tue Dec 10, 2013 3:47 pm
by raduc
Right now there is no way to get or set custom alpha channels from max script, but the next plugin version will contain two new functions maxwellGetCustomAlphaChan and maxwellSetCustomAlphaChan that will let you manipulate custom alpha channels on objects.
The function that sets the alpha channels does some internal validation so that you can't accidentally set a channel that doesn't exist, but due to this you can't set the custom alpha channels unless the active renderer is Maxwell.

Here is an example that assumes Channel0-Channel5 were created beforehand:
Code: Select all
maxwellGetCustomAlphaChan($Box001) - returns #(#Channel0, #Channel1, #Channel2)
nameArr = #(#Channel2, #Channel4, #Channel5, #Channel6)
maxwellSetCustomAlphaChan $Box001 nameArr
maxwellGetCustomAlphaChan($Box001) - returns #(#Channel2, #Channel4, #Channel5) because #Channel6 doesn't exist

Re: custom alphas via maxscript?

Posted: Tue Dec 10, 2013 6:43 pm
by egmehl
That would be perfect. And even better if there's also a way to create the channels, though I know how twisted the Max API can be so maybe that isn't possible.

Re: custom alphas via maxscript?

Posted: Wed Dec 11, 2013 6:39 am
by sandykoufax
With current Max plugin (3.0.14), custom alphas available?
I cannot find the way to assign objects to channel. :?

Re: custom alphas via maxscript?

Posted: Wed Dec 11, 2013 1:37 pm
by raduc
sandykoufax wrote:With current Max plugin (3.0.14), custom alphas available?
I cannot find the way to assign objects to channel. :?
Yes, you can create custom alpha channels from the render channel UI, the channels have to be created before you can assign them.
To assign a custom alpha channel on an object you can do the following:
- Select the object
- Right click->Object Properties->Maxwell tab
- In the custom alpha list double click the channel that you want the object to be a part of.

You can also select multiple objects to set them on a custom channel all at once.

Regards,
Radu

Re: custom alphas via maxscript?

Posted: Wed Dec 11, 2013 2:48 pm
by sandykoufax
Ah-ha! Thank you, raduc. :)

Re: custom alphas via maxscript?

Posted: Wed Dec 11, 2013 6:09 pm
by egmehl
Are there any known problems with instances and custom alphas? I had an issue yesterday where all my objects with custom alphas that were instanced (Max instances, not mxProxy) were not showing up at all. No shadow casting or anything, like they were completely taken out of the scene. Turning off instancing didn't work and even rendering an object by itself didn't help. Only fix was to import a copy of the objects from a saved file before I added the custom alpha settings.

I'm on deadline now but will hopefully have more time to experiment and get a better set of info to you that led up to the problem.