Soft Selection to Vertex Colours.

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 12 December 2008   #1
Soft Selection to Vertex Colours.

So you've got some nice procedural effects working via volume selection, soft selections etc. But then in comp you need a mask. So how do you render the soft selection?

Well as far as I can tell this is the only way? Please tell me if I'm wrong.

(change Box01 to anything u like)
First run this.
channelInfo.addChannel $Box01



Then add a pre-render script.
channelInfo.CopySubChannel $Box01 2 0 0

channelInfo.PasteSubChannel $Box01 3 2 0
channelInfo.NameSubChannel $Box01 3 2 0 "-none-"
channelInfo.PasteSubChannel $Box01 3 2 1
channelInfo.NameSubChannel $Box01 3 2 1 "-none-"
channelInfo.PasteSubChannel $Box01 3 2 2
channelInfo.NameSubChannel $Box01 3 2 2 "-none-"


Then add a material with Vertex Color map in diffuse, and set to map 2. self illum 100

Or have I totally missed something?
__________________
Maxscript Made Easy...
http://davewortley.wordpress.com/
 
Old 12 December 2008   #2
Ok I need some pretty urgent help working out why this won't work when rendering multiple frame sequences.

Any ideas?
__________________
Maxscript Made Easy...
http://davewortley.wordpress.com/
 
Old 12 December 2008   #3
1. A pre-render script is only called at the beginning of the sequence, not for each frame. You'd want to look into adding a #preRenderFrame or #preRenderEval for that.

2.a Even with that, you may not be allowed to change vertex colors in those stages of the render progress. Only way to find out is to try.
2.b Which I just did, and although it 'works' (prerendereval, tried prerenderframe and max complained about missing uvw channel 2 and crashed), you need to...

3.a Redraw your viewports at the time of the render.. e.g. sliderTime = currentTime, make sure the viewport redraws.
3.b Or figure out some other way to get the copy/paste UVW bit to recognize the changed selection

btw, the code 'as is' seems to generate a ton of copy/paste modifiers, slowing down a render progressively.. may wish to add clean-up code to remove them when done at each frame.
 
Old 12 December 2008   #4
out of curiosity - did you get this working to satisfaction?
 
Old 12 December 2008   #5
Yeah I did. I had to write my own Render script to make it work.

Luckily the object envolved was a Cube so I could disable all the other modifiers make 6 cameras and then in Fusion render these on the UV layouts to be able to put the map back on the object again.

I simply didn't have enough time to work out how to Render to Texture using maxscript how I would have liked to... :( Would loved to be filed in.

To avoid the multiple UV Channel modifier problem, I simply added 3 before I ran the script and got the script to delete the first three before adding them again.

My script was very very slow with my volume select that I was using, but would like to hear if there's any way I can improve my script.


for i = 0 to 80 do  --FRAME RENDER SEQUENCE LOOP
(

sliderTime = i --get Current time
at time i 
(
--Get rid of old modifiers with Vert Data in
deleteModifier $CUBE_MORPHER 1
deleteModifier $CUBE_MORPHER 1
deleteModifier $CUBE_MORPHER 1

--Copy the vsel data channel to the r, g and b channels, (in hindesight I could have just used one channel and selected the channel in Fusion, which should improve performance)

channelInfo.CopySubChannel $CUBE_MORPHER 2 0 0
channelInfo.PasteSubChannel $CUBE_MORPHER 3 2 0
channelInfo.NameSubChannel $CUBE_MORPHER 3 2 0 "-none-"
channelInfo.PasteSubChannel $CUBE_MORPHER 3 2 1
channelInfo.NameSubChannel $CUBE_MORPHER 3 2 1 "-none-"
channelInfo.PasteSubChannel $CUBE_MORPHER 3 2 2
channelInfo.NameSubChannel $CUBE_MORPHER 3 2 2 "-none-"

--Render Script
frameN = formattedPrint i format: "04d"
path = ("c:/TEST/TEXMAP_CAM1_" + frameN + ".tga")
bm = Render frame:i camera:$Camera01 vfb:false progressbar:true
bm.filename = path 
Save bm


--Clean up
gc()

)
)
__________________
Maxscript Made Easy...
http://davewortley.wordpress.com/
 
Old 12 December 2008   #6
Writing your own tool to do what a freeware plugin already does. Try Grant Adam's Blur Vertex Color (NOTE: feature only available with 2009).
Quote: New feature for 2009 version - can convert a stack vertex selection to vertex colours (allowing it to be used as a mask in a material etc.). UI snapshot and quicktime demo below.
-Eric
__________________
"The Evil Monkey hiding in your closet."
 
Old 12 December 2008   #7
Nice, but we use 3dsmax 9, so would have been a headache to deal with anyway, but will bare it in mind next time. Thanks!

Has anyone used it, is it fast?
__________________
Maxscript Made Easy...
http://davewortley.wordpress.com/
 
Old 12 December 2008   #8
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 02:53 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.