[Req] Viewporter
-
Thomthom, i think this ones for you because your becoming my personal ruby script genie (and your a vray-head)but i would appreciate help from anyone: with vray theres a handy little option in the output tab called "get view aspect" where i can squash my entire sketchup window to a very long horizontal shot, now i can lock the aspect ratio (even save the scene) to preserve the view and take my model home to work on, but with different monitor sizes i never see entirly what im rendering until render time, in maxwel render (or fry? theyre both the same to me) they have grey transparent bars that appear on the SU display showing the limits of what will be rendered, any way to get this as a standalone ruby???
interestingly: with maxwell (or fry?) if u apply those grey bars (or whatever theyre called) they are still visible on any computer that opens that file even if that PC doesnt have maxwell installed.
-
Funny you should mention this... I've been playing with this idea myself... All thought I've not looked into it and I'm not sure how it'll be done. If anyone feel like taking a shot at this it'd great. I don't wanna chew over more than I can handle.
One of the reasons why I don't want to commit right now is that I don't know how easy/difficult it'd be. I've fallen into this trap before where I've committed myself to too many things at the same time. (for instance, I'm currently playing around with a V-Ray light manager... sshhhh! )
hmm... without seeing it, I'm wondering if Fry and/or Maxwell adds two rectangles with a translucent material which always stays positioned in front of the camera. So the procedure would be to get the viewport aspect ratio from V-Ray (which I suspect is located inside some dictionary attribute somewhere in the model) and then calculate the size and position of these rectangles...
-
A good starting point for this ruby would be from this blog entry from the SketchUp API Blog: http://sketchupapi.blogspot.com/2008/11/storing-and-retrieving-with.html
The snippet described there creates some geometry from the point of the camera.
I've compiled it into one ruby file and attached it for the convenience of anyone who might like to pick up this project.
-
Just had an idea... maybe this can be done using Watermarks... Just not sure if it works when you move across different monitor resolutions...
-
How do you display these gray bars in Fry render? I installed the demo to have a look. Closest thing I get is the 'Show safe frame', but that doesn't stick around for long. dissappears to fast. And I thought i would have displayed the frame based on the output resolution set in Fry....
-
Hi guys,
I think it shouldn't be very hard to do in ruby (me saying this as an ultimate non scripter). Both the Film and stage plugin creates those grayed-out stripes on the sides allowing you to see what's really on the camera andthe CubicPanoOut.rb plugin which creates six images (and - on request - six scenes you can see these bands on) during the export.
Then there is the FixAspectRatio.rb plugin that will remove these bands...
Obviously, a "stripped down" version for something like this - just to make sure that what you see is what you get AND to be able to export really custom size images (either directly from SU or via a render app) could come in really handy.
There are some renderers that can render exactly what you see on the SU window - thus making you able to make nice transitions for instance (obviously, Podium is one since it uses the SU viewport itself - but also Kerkythea which will, when the model is exported,put you into the same viewport with exactly the same aspect ratio and camera settings).
-
Thanks for pointing out these plugins Gaieus. If they can be stripped down, (with permission, ofcourse) to only the function of displaying the bars, the only other thing would be to extract the V-Ray settings to get the aspect ratio. Though, being able to set this manually would work as well, and should probably be included so it's not V-Ray exclusive.
-
Well, this was very interesting. The grey bars are a feature built into SU. Just not exposed via the default UI. Makes things much easier.
-
Even better - I didn't know that (which is not surprising )
-
they're built in? how do u access them? and thom thom if show safe frame didnt work on fry render then perhaps its maxwell that does it. thanx for the attension
-
Via the ruby API you can set the aspect ratio of the SU camera's. And when that aspect ratio doesn't match the viewport the excess spaces is masked by the translucent dark band.
As an example, if you open the Ruby console and paste the following line you see the effect.
Sketchup.active_model.active_view.camera.aspect_ratio = 2.2
However, V-Ray doesn't seem to be aware of this. If you set V-Ray to render with an aspect of 2.2, you won't get what you see in SU if you set SU's aspect to 2.2. The SU viewport will zoom in, but V-Ray will still render the same image as before. To remedy this the V-Ray Camera's Zoom have to be set to the ratio of the SU viewport.
Example of getting What You See in SU Is What You get In V-Ray:
My monitor which I have SU open on is an 22" monitor with 1680x1050. With my current setup of toolbars the SketchUp viewport size is 1676x918. That's a ratio of ~1.8257
If I set V-Ray to have an output ratio of 2.2 (800x363) and I make SU's camera have an ratio of 2.2 by using the commandSketchup.active_model.active_view.camera.aspect_ratio = 2.2
I then have to set the V-Ray's camera's Zoom factor to 1.8257
What's annoying is that if you want to export the SU view when a custom aspect ratio is applied it won't take into account the new aspect ratio. It insists on using the ratio of the whole viewport. Fortunatly, this can be worked around by a ruby command which allows you to save out only the part you want and which will match perfectly when you overlay them in Photoshop.
Not sure if you can match things up if you do not use Physical Camera in V-Ray.
So, I think I have the formula, the problem is getting the V-Ray settings and to be able to adjust the V-Ray settings from the Ruby. That will take some tweaking as there's no documentation.
-
any progress?
-
Afraid not. I have to reverse engineer the V-Ray data and I've not had time for that yet. The data isn't availible in a straight forward manner.
-
thanx for your time
-
I made some progress yesterday though. Think I'm able to reliably read the V-Ray settings. Next is to see if I can write new settings as I need to adjust the Camera Zoom to sync V-Ray camera with V-Ray. Getting there.
-
Thomthom, I'd be interested in a solution as well.
-
I'll post an experimental version on this forum for people to test. Note that I develop against the latest VfSU release, 1.05.03 (SR1.5).
-
wow thomthom, while your at it see if you can cook us up a "render region" silly that they dont have it all ready
-
Yeah, render region is something I reeeaaally would like to see for Vray for SU. I've asked for it several times and they only say it's added to the to do list. It would be a tremendous time saver for me.
-
Got some bad news and some worse news.
Bad news:
It's harder to read the V-Ray settings than I thought. The location of the data moves depending on other setting. That mean I'd have to read a whole lot of more settings in order to work out the data I need.Worse news:
There doesn't appear to be any way to change the V-Ray data. The attributes stored in the model is only read by V-Ray when the file is opened, but not while the file is open.How to deal with this:
I will contact ASGVis and see if they're willing to share some information that might help. Also propose an API or something that will make it easier to script VfSU in the next version.
In the meanwhile I'll create a calculator where you manually type in the aspect ratio you want and it'll give you a number for which you have to enter in the Zoom property for the Physical Camera in order to match the SU viewport with VfSU. It basically means a semi-automatic solution.
Advertisement