regioncrop not working correctly

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
  09 September 2009
regioncrop not working correctly

Hi everyone

I realized that somethings wrong with regioncrop. look at the code i wrote. It should render exactly the same image as a render command without cropping. However, it returns an image that is exactly one pixel too high and wide. This one pixel renders as a black line right, and at the bottom (best turn environment to white to see it). This is really bothering me. And the worst part is that i get it with any numbers in the crop dialog, always two black lines. How does this happen, and how can i overcome the problem? Is it a bug?

 c = freecamera() 
 viewport.setCamera $camera01
 render camera:$camera01 rendertype:#regioncrop region:#(0,0,renderwidth,renderheight)


Curiously, the problem does not happen when i manually set the activeviewport to the camera and run only the last line of code.

Help is very appreciated.
 
  09 September 2009
Maybe you can add a redrawviews() to force it update the view prior to rendering. What about if you try supplying a Box2 instead of the array does that work?

-Eric
__________________
"The Evil Monkey hiding in your closet."
 
  09 September 2009
oh, i was so excited when i saw this reply and the redrawviews command, but unfortunately, it wasn't the solution. Even a forcecompleteredraw led to no change. But please continue thinking about the problem, i urgently need a working solution.

c = freecamera() 
   viewport.setCamera $camera01
   forceCompleteRedraw()
   theregion = box2 0 0 (renderwidth-1) (renderheight-1)
   render camera:$camera01 rendertype:#regioncrop region:theregion
 
  09 September 2009
Question is the output one pixel larger? Or is it the correct size with a row of black pixels? Just trying to figure out the problem. What about using EditRenderRegion Interface to set the desired area, and then submit a region render without the region: parameter set?

-Eric
__________________
"The Evil Monkey hiding in your closet."
 
  09 September 2009
Originally Posted by PiXeL_MoNKeY: Question is the output one pixel larger? Or is it the correct size with a row of black pixels?


It is the correct size, but with a row and a column of black pixels. Can you reproduce the effect on your computer?
Attached Images
File Type: jpg onepixel.jpg (550 Bytes, 45 views)
 
  09 September 2009
tried a different approach but got the same awkward result.
c = freecamera() 
   viewport.setCamera $camera01
   theregion = box2 0 0 (renderwidth-1) (renderheight-1)
   viewport.setregionrect 1 theregion
   forceCompleteRedraw()
   render camera:$camera01 rendertype:#regioncrop
 
  09 September 2009
ok, guess i found a workaround that works. Instead of using render() and a defined region. I use the max quick render command. Seems to be the only way to get a region render without black lines. very weird problem, though...


 c = freecamera()
 renderscenedialog.close()
 viewport.setCamera c
 theregion = box2 0 0 (renderwidth-50) (renderheight-50)
 setRenderType #crop
 viewport.setregionrect 1 theregion
 EditRenderRegion.UpdateRegion()
 forceCompleteRedraw()
 max quick render 
 theimage = getLastRenderedImage()
 display theimage
 


Is this script elegant enough or will i run into unexpected difficulties?
 
  09 September 2009
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 03:52 AM.


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