SketchUcation Premium Membership

 

 

[Plugin] 'Camera2Vue.rb'

[Plugin] 'Camera2Vue.rb'

Postby Alex Jenyon » Fri May 22, 2009 11:30 am

Thanks to some help from some ruby masters, I've managed to adapt Grant Marshall's 'Camera2Modo' script to export SketchUP cameras to E-on software's 'Vue' digital environment software.

I hope it's useful. I've tested it on SU6 with Vue 7 infinite on a Mac. It will almost certainly work with SU6 on a PC, and with Vue7 / 7.4 infinite / xstream on either platform. Not tested with SU7.

Here's my 'proof of concept'

SU Render:


Vue Render:


Combined:


You can download the script, a vue scene ready-setup and a tutorial here:

camera2vue.zip


I don't seem to be able to make the files into an attachment (might be safari), so if someone else / a mod can do it, that would be great. Let me know if there are any problems.

Enjoy.

AJ
Please, register (free) to access all the attachments on the forums.
Concept artist / Matte painter
www.aj-concepts.net
Alex Jenyon
 
Posts: 72
Joined: Mon Nov 19, 2007 10:22 am
Location: London

Re: [ Plugin ] 'Camera2Vue.rb'

Postby matteo » Fri May 22, 2009 1:44 pm

If this works, and I don't see why it should not (since you tested different combinations of vue + sketchup) thank you very much! :berserk:

I'll stop to to do the edge overlay by hand, attempting to match the vue perspective with the sketchup output set as background.

I really like to combine sketchup edges with a radiosity rendering of the some view. :thumb:
matteo
 
Posts: 211
Joined: Tue Feb 19, 2008 10:43 am
Location: merano, south tyrol, italy
Name: matteo bignozzi
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [ Plugin ] 'Camera2Vue.rb'

Postby remus » Fri May 22, 2009 1:57 pm

Attached the file, not sure why it didnt work for you.

thanks for the script, as well. Although i dont use vue, im sure those who do will make good use of it.
remus
 
Posts: 8055
Joined: Fri Nov 30, 2007 8:48 am
Location: UK
Name: remus

Re: [ Plugin ] 'Camera2Vue.rb'

Postby Chris Fullmer » Fri May 22, 2009 4:59 pm

Looks great, thanks Alex! Hopefully I'll get to use Vue more in the future and then I'll check this out in more detail,

Chris
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer
SketchUp Team
 
Posts: 6680
Joined: Wed Nov 21, 2007 3:21 am
Location: Davis, CA
Name: Chris Fullmer
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: landscape architecture
Level of SketchUp: Advanced

Re: [ Plugin ] 'Camera2Vue.rb'

Postby solo » Fri May 22, 2009 5:08 pm

Alex

Thank you so much for your efforts in bringing another very needed script to our community and especially when it involves SU and Vue.

Would you mind if I did a video tutorial for the guys at geekatplay and Cornicopia so they too can benifit from this script?
My site

Quod gratis asseritur, gratis negatur.
User avatar
solo
Global Moderator
 
Posts: 10749
Joined: Mon Nov 12, 2007 1:46 pm
Location: Dallas, Texas
Name: Pete Stoppel
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: [ Plugin ] 'Camera2Vue.rb'

Postby solo » Fri May 22, 2009 5:10 pm

one last thing...how does it work? :oops:
My site

Quod gratis asseritur, gratis negatur.
User avatar
solo
Global Moderator
 
Posts: 10749
Joined: Mon Nov 12, 2007 1:46 pm
Location: Dallas, Texas
Name: Pete Stoppel
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: [ Plugin ] 'Camera2Vue.rb'

Postby Alex Jenyon » Fri May 22, 2009 5:13 pm

@Solo:

There's a 'readme' file in the zip folder I uploaded, which hopefully explains everything.

Let me know if you have any trouble getting it to work - I haven't tried it on any system apart from mine yet, so a bit of testing is probably in order.

If it's working well for you, then please post the script / tutorials wherever you want.

Enjoy!

AJ
Last edited by Alex Jenyon on Fri May 22, 2009 5:36 pm, edited 1 time in total.
Concept artist / Matte painter
www.aj-concepts.net
Alex Jenyon
 
Posts: 72
Joined: Mon Nov 19, 2007 10:22 am
Location: London

Re: [ Plugin ] 'Camera2Vue.rb'

Postby solo » Fri May 22, 2009 5:34 pm

Ah, seems to be working, the one thing that I missed was my SU resolution/aspect vs Vue render size.
My site

Quod gratis asseritur, gratis negatur.
User avatar
solo
Global Moderator
 
Posts: 10749
Joined: Mon Nov 12, 2007 1:46 pm
Location: Dallas, Texas
Name: Pete Stoppel
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: [ Plugin ] 'Camera2Vue.rb'

Postby matteo » Fri May 22, 2009 6:00 pm

hi Alex,

I've tested it with Vue 7 Esprit on windows xp: sadly it can't read this kind of python script (see attached image).

Howerer, if i open the python script with a text editor, i can copy and paste the camera coordinates and orientation into the upper right panel of Vue.

Now my problem is how to convert SU fov to Vue fov, since I can't find the the box labelled 'Vertical FoV' in the advanced camera options of Vue 7 Esprit. I'll have to develop a small trigonometric function to convert it.
Please, register (free) to access all the attachments on the forums.
matteo
 
Posts: 211
Joined: Tue Feb 19, 2008 10:43 am
Location: merano, south tyrol, italy
Name: matteo bignozzi
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [ Plugin ] 'Camera2Vue.rb'

Postby solo » Fri May 22, 2009 6:14 pm

success!!



My site

Quod gratis asseritur, gratis negatur.
User avatar
solo
Global Moderator
 
Posts: 10749
Joined: Mon Nov 12, 2007 1:46 pm
Location: Dallas, Texas
Name: Pete Stoppel
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: [ Plugin ] 'Camera2Vue.rb'

Postby craftycurate » Sat May 23, 2009 1:07 pm

Hi ...

Thanks for making Camera2Vue available ...

However, although I'm sure I followed the instructions, the scene does not appear as expected - the camera is not positioned correctly relative to the 3B object.

I don't have Sketchup Pro so can't export as as OBJ with "swap yz" - would that make a difference?

I am using an OBJ exporter script instead.

Thanks
Richard
craftycurate
 
Posts: 11
Joined: Thu Apr 10, 2008 4:03 pm

Re: [ Plugin ] 'Camera2Vue.rb'

Postby Alex Jenyon » Sat May 23, 2009 10:02 pm

@craftycurate:

I'm honestly not sure - I just tried to record my own process as closely as possible.

It's worth checking in 'vue' to see if the orientation of the object is *nearly* right - i.e. the vertical axis in SU is the same as the 'up' in Vue.

If it is, there are a couple of things to check:

1. The field of view matches (SU's 'field of view' is the VERTICAL field of view in 'VUE'

2. The units are the same. My script outputs the camera data in METRES. If your obj exporter uses mm, feet, or something else it's not going to match.

3. The object is not hidden by the ground plane in 'vue' (delete it to make sure). Also check that vue doesn't automatically centre or resize your obj geometry.

Hope you can sort it out!

@matteo:

Vue d'esprit can only read python scripts that e-on has created themselves. I don't have a copy, so I can't test out your problem. It should be possible to use the FoV and the aspect ratio to calculate the camera focal length - there's plenty of info around on how to do this, but it's a bit tricky. Let me know if you find a workaround, and I might try to add it to the script.

@Solo:

Yay! Great news - glad you got it playing ball. Did it work the way I described, or did you have to put in a bit of extra legwork?
Please put together a video tutoral if you've got the time - I'm not sure it's something I'm going to be able to do.

Thanks for your time everyone - most appreciated.

AJ
Concept artist / Matte painter
www.aj-concepts.net
Alex Jenyon
 
Posts: 72
Joined: Mon Nov 19, 2007 10:22 am
Location: London

Re: [ Plugin ] 'Camera2Vue.rb'

Postby craftycurate » Sat May 23, 2009 10:14 pm

Hi Alex ...

Thanks - I'll try out your suggestions.

Cheers
Richard
craftycurate
 
Posts: 11
Joined: Thu Apr 10, 2008 4:03 pm

Re: [ Plugin ] 'Camera2Vue.rb'

Postby craftycurate » Sat May 23, 2009 10:59 pm

I'm very close but not quite there - not sure what needs changing. I am working at maximum precision in Sketchup ... maybe rounding errors in Vue, which only accepts 3 dps.

it isn't just a scaling error, but there is a slight rotational one too - the left corner is matched, but the bottom one isn't.

I import the SKP file into Vue as an SKP - the free OBJ exporter creates a mirror image for some reason.

If I can get this working for the SKP file, it might be useful to other Free SU users.

Cheers
Richard
Please, register (free) to access all the attachments on the forums.
Last edited by craftycurate on Sat May 23, 2009 11:16 pm, edited 1 time in total.
craftycurate
 
Posts: 11
Joined: Thu Apr 10, 2008 4:03 pm

Re: [ Plugin ] 'Camera2Vue.rb'

Postby craftycurate » Sat May 23, 2009 11:15 pm

Here's another one - used a Sketchy Edge style to cover the inaccuracies, but it looks quite nice!
Please, register (free) to access all the attachments on the forums.
craftycurate
 
Posts: 11
Joined: Thu Apr 10, 2008 4:03 pm

Re: [ Plugin ] 'Camera2Vue.rb'

Postby Marian » Sat May 23, 2009 11:34 pm

Doest it work with any of those free vue types?
User avatar
Marian
 
Posts: 1340
Joined: Thu Jan 03, 2008 10:31 am
Location: Suceava / Cuj-Napoca, Romania
Name: Marian

Re: [ Plugin ] 'Camera2Vue.rb'

Postby solo » Sun May 24, 2009 12:27 am

Should work with the PLE version.
My site

Quod gratis asseritur, gratis negatur.
User avatar
solo
Global Moderator
 
Posts: 10749
Joined: Mon Nov 12, 2007 1:46 pm
Location: Dallas, Texas
Name: Pete Stoppel
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: [ Plugin ] 'Camera2Vue.rb'

Postby solo » Sun May 24, 2009 10:37 pm

Here is a quick pdf tutorial with installation files:

http://www.box.net/shared/md8inqn1yd
My site

Quod gratis asseritur, gratis negatur.
User avatar
solo
Global Moderator
 
Posts: 10749
Joined: Mon Nov 12, 2007 1:46 pm
Location: Dallas, Texas
Name: Pete Stoppel
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: [ Plugin ] 'Camera2Vue.rb'

Postby Alex Jenyon » Mon May 25, 2009 12:11 pm

@Solo: That's brilliant - thank you so much for taking the time to put that together. Mind if I host a mirror of it on my own server?

@craftycurate: Can you upload / email me the skippy file, and let me know which version of 'Vue' you are using? I'll look into it, see if I can some up with a solution for you. alex [at] aj-concepts.net

Cheers

AJ
Concept artist / Matte painter
www.aj-concepts.net
Alex Jenyon
 
Posts: 72
Joined: Mon Nov 19, 2007 10:22 am
Location: London

Re: [ Plugin ] 'Camera2Vue.rb'

Postby solo » Mon May 25, 2009 2:06 pm

Sure thing Alex.
My site

Quod gratis asseritur, gratis negatur.
User avatar
solo
Global Moderator
 
Posts: 10749
Joined: Mon Nov 12, 2007 1:46 pm
Location: Dallas, Texas
Name: Pete Stoppel
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: [ Plugin ] 'Camera2Vue.rb'

Postby Alex Jenyon » Mon May 25, 2009 2:56 pm

Okay, I've got a workaround for folks who only have SUfree.

I have absolutely no idea WHY it works, but it seems to - so please test it and see if you can work it out yourself.

1. Export the geometry as a google earth .kmz file

2. Rename the file from name.kmz to name.zip (i.e. change the file type to .zip)

3. Unzip the .zip file

4. Open the 'models' folder, and find 'name.dae' - this is a collada file

5. Import the collada file to 'Vue'

6. Scale it by 3.937. No, I have no idea why, but it seems to work. Anyone know why it's this value?

(To do this, if you're not sure: Select your object, and click on the 'size' icon - the cube that's been stretched vertically. Calculate what the 'x' size of the object multiplied by 3.937 is. Then lock x, y and z sizes together - using the padlock icon - and enter this value in the 'x' size field. All the values should scale together.)

7. Follow the rest of my method to match the camera.

AJ
Concept artist / Matte painter
www.aj-concepts.net
Alex Jenyon
 
Posts: 72
Joined: Mon Nov 19, 2007 10:22 am
Location: London

Re: [ Plugin ] 'Camera2Vue.rb'

Postby sepo » Mon May 25, 2009 3:30 pm

Will it work with Vue 5 Infinite ?
sepo
 
Posts: 1559
Joined: Wed Nov 14, 2007 1:19 pm
Location: Northampton UK
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [ Plugin ] 'Camera2Vue.rb'

Postby Alex Jenyon » Mon May 25, 2009 4:02 pm

@sepo - I don't know, and don't have any way of testing it.... Only one way to find out, I guess.

I'm using fairly basic python commands in Vue, but I think the command to select the camera changed between Vue 6 and Vue 7, which might mean the script doesn't work.

You could try deleting the first two lines of the python script, manually selecting the camera in Vue, and then running the script normally.

Otherwise, you might need to do a bit of digging into the python documentation for Vue 5 to get it working seamlessly, but it shouldn't be too tricky.

AJ
Last edited by Alex Jenyon on Mon May 25, 2009 4:43 pm, edited 1 time in total.
Concept artist / Matte painter
www.aj-concepts.net
Alex Jenyon
 
Posts: 72
Joined: Mon Nov 19, 2007 10:22 am
Location: London

Re: [ Plugin ] 'Camera2Vue.rb'

Postby sepo » Mon May 25, 2009 4:36 pm

Ok I will try and let you know. Thanks for your reply. I never really upgraded from Vue 5 as I hated camera...Donno if it is any better now.
sepo
 
Posts: 1559
Joined: Wed Nov 14, 2007 1:19 pm
Location: Northampton UK
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [ Plugin ] 'Camera2Vue.rb'

Postby craftycurate » Mon May 25, 2009 5:19 pm

Alex Jenyon wrote:@sepo - I don't know, and don't have any way of testing it.... Only one way to find out, I guess.

I'm using fairly basic python commands in Vue, but I think the command to select the camera changed between Vue 6 and Vue 7, which might mean the script doesn't work.

You could try deleting the first two lines of the python script, manually selecting the camera in Vue, and then running the script normally.

Otherwise, you might need to do a bit of digging into the python documentation for Vue 5 to get it working seamlessly, but it shouldn't be too tricky.

AJ


Thanks Alex - it works beautifully. Looks pixel perfect. Here's an example render.

Thanks for all your help & for providing this great script - I'll be interested to try it with some architectural models.
Richard
C2V Test4.jpg
Please, register (free) to access all the attachments on the forums.
craftycurate
 
Posts: 11
Joined: Thu Apr 10, 2008 4:03 pm

Re: [ Plugin ] 'Camera2Vue.rb'

Postby sepo » Mon May 25, 2009 7:07 pm

Are you saying it works with Vue 5?
sepo
 
Posts: 1559
Joined: Wed Nov 14, 2007 1:19 pm
Location: Northampton UK
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [ Plugin ] 'Camera2Vue.rb'

Postby craftycurate » Mon May 25, 2009 7:23 pm

By the way, a workflow tip that will help with the scaling issue (via Alex's Collada method).

If your SKP model has a nice bounding box, simply measure the length of one of those sides in SKP, and then paste that dimension into the corresponding dimension in Vue.

If that isn't possible, scaling by 3.937 will do the same job.
craftycurate
 
Posts: 11
Joined: Thu Apr 10, 2008 4:03 pm

Re: [ Plugin ] 'Camera2Vue.rb'

Postby craftycurate » Tue May 26, 2009 12:23 am

OK another render, to prove the method works with complex models which would show up flaws.

I've added a subtle outline, which is the SKP render, overlaid on a Vue 7 Global Radiosity render, though it looks great with a simple Ambient Occlusion one too.

View in full size to see the detail.

Thanks
Richard
Please, register (free) to access all the attachments on the forums.
craftycurate
 
Posts: 11
Joined: Thu Apr 10, 2008 4:03 pm

Re: manual input to Vue 7 Esprit: it works!

Postby matteo » Tue May 26, 2009 9:10 am

So, there is no need for trigonometric conversions to convert degrees into 35mm camera FoV, as I feared.

Here the steps to make it work in Vue 7 Esprit.

1) Run the plugin 'camera to vue' inside sketchup and, when you're prompred to save the python script, save it as simple text by adding the '.txt' extension to the name you choosed to save it.

2) Open it with a text editor and leave it open.

3) In Vue just go to the options panel and under 'display options' check -show camera Fov in Object properties-.

4) Select the camera and copy and paste from the previous opened text all the single values of camera position and rotation, plus Sketchup's field of view in the upper right panel.

You're done:
render and enjoy!

/matteo
Please, register (free) to access all the attachments on the forums.
matteo
 
Posts: 211
Joined: Tue Feb 19, 2008 10:43 am
Location: merano, south tyrol, italy
Name: matteo bignozzi
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

to Alex: the mystic 3,93700787 number

Postby matteo » Tue May 26, 2009 9:25 am

The funny standard measure unit of Vue, 10,00cm, divided by one inch (2,54cm) equals 3,93700787

But don't ask me why this is needed :shock:
matteo
 
Posts: 211
Joined: Tue Feb 19, 2008 10:43 am
Location: merano, south tyrol, italy
Name: matteo bignozzi
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Vertex Tools for SketchUp. Take control over each vertex with this vertex editor for SketchUp.

Premium Members get 20% discount!

Ad Machine
Robot
 
Posts: 2012

Next

Return to Plugins

Who is online

Users browsing this forum: 3DART, Graffic, KCQruim, proxy, Travel Trousers and 10 guests