PDA

View Full Version : meshsmooth in render?


Morbid Angel
02-26-2003, 10:32 PM
Guys in 3d studio max there is an option where you can apply meshsmooth to the object. Its similar to mayas smooth (poly)
only I want to know is if this is possible:
when meshsmooth is applyed it can be set that in the view port it is not visible or division at 0, but in the render it can be anything like 2 or whatever.
PLZ help its critical.
besically, in view port not smooth, in render smooth.

CaptRuss
02-26-2003, 10:38 PM
Well, if you use the smooth proxy method, you can alter the subdivision level at any time with a mel command. Youll have to look at the manual to get that. The upswing is the render options has entries for pre- and post- render mel commands. add the command to "res it up" before, and bringit down after.

boom, semi easy rendertime smoothing...

best I can do at the mo' anyone?


Capt Russ

Morbid Angel
02-26-2003, 10:39 PM
see smooth proxy is you have to manually turn them on and off. I need automated

playmesumch00ns
02-26-2003, 11:07 PM
CaptRuss is on the right lines. All you have to do is go down the network of you object and find the polySmooth node that's doing the work. Assuming it's called polySmooth1, you just do this:

setAttr polySmooth1.divisions 2

to set the smoothing to 2.

So all you do is in the pre-render script put in the command above.

If it's more than one object, say n objects, then you just make a procedure like so:

global proc renderSmooth()
{
setAttr polySmooth1.divisions 2
setAttr polySmooth2.divisions 2
...
setAttr polySmoothn.divisions 2
}

and I think you'll probably want a post-render script like so:

global proc renderUnSmooth()
{
setAttr polySmooth1.divisions 2
setAttr polySmooth2.divisions 2
...
setAttr polySmoothn.divisions 2
}

to set them back again.

Then you just call renderSmooth() in pre-render, and renderUnSmooth() in post-render.


Now, having said that, I'm not sure if calling a procedure from the pre-render will always work. Haven't got maya here to tes, but you can get round it like this. Actually this method makes the whole thing a lot easier.

1) make a locator, call it smoothLoc
2) add a "smoothing" int attribute
3) select all your polySmooth nodes in the hypergraph and then run this script:

$sel = `ls -sl`;
for ($sm in $sel)
{
connectAttr smoothLoc.smoothing ($sm+".divisions");
}


et voila, your objects' smoothing will be controlled by the attribute on the locator. Then you can definitely use this to control smoothing at render-time just by calling

setAttr smoothLoc.smoothing 2;
and
setAttr smoothLoc.smoothing 0;

pre- and post-render respectively

CGTalk Moderation
01-14-2006, 12:00 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.