Grasshopper

algorithmic modeling for Rhino

i wrote this definition that will take all of your named views and write out a native Maya file with maya cameras that match your named views. the maya cameras are named the same as your named views in rhino.  i wrote this in a grasshopper component for other reasons but the code can be used for a native rhino script function if you just want a button in rhino (i should have done it in python now that i think of it!)  

the main reason for this is that i often like to composite line work on top of renders to make make composite drawings and having matched cameras in the two programs is nice. i am finishing up a python script for maya that goes the other way (maya cameras to named views in rhino) but its not done yet. 

this will be rolled into the next version of cerver tools but here is the raw component

Enjoy!

Views: 7456

Attachments:

Replies to This Discussion

i do not think obj has support for cameras. 3ds is possible, my script is open so it would not be hard to modify if you want. 

if you trying to get the camera into Max i was thinking about changing the script to use Alembic which is a new favorite format of mine. then it would work in max, maya, and softimage. 

Hi Robert,

Firstly, thanks for the awesome script.

The script works, but the imported camera in maya doesnt align perfectly.

I have the model in Rhino 5 SR4 and exported it as .OBJ for Maya 2013.

I selected the correct cameras and rendered out a jpg from Rhin and a vector image from Maya.

When I try to composite them both in Photoshop, I discovered that the vector doesnt align to the jpg.

Can you post a screen shot. I just used I recently for something similar and it aligned perfect. Perhaps there are something odd with the camera. Are you using perspective because I don't know if it will work if you have the cameras set to parallel in rhino. 

Red line = Vector render from Maya. (I desaturated all the lines except for one voronoi cell)

The geometries you see is rendered from Rhino using VRay.

Here's what I did:

  1. Baked the model from Grasshopper.
  2. Position the perspective viewport and created a NamedView in rhino.
  3. Set the resolution to 1600 x 1130 and rendered with VRay
  4. Select all geometries and used "Export Selected" and chose ".iges"
  5. Open up the .iges file and did a -90 rotate correction.
  6. Set up render settings to 1600 x 1130 and rendered with Vector render.
  7. Compositie in photosop.

Those are the steps, I took. I also used obj as file type, it produced more edges, but it still didnt align.

Thanks Robert! This one works great. 

Here are two tips based on my failure:

1. when export obj. make sure to check < Map Rhino Z to OBJ Y>

2. try not to  do alt + rightclick to zoom the view in Maya. The model might appear the same but the vanish point was changed without notice.

Hope this help:) 

Robert.. looking for some help here. This script seems so perfect and easy but I am having unexplained errors in both directions. I have tried your method word for word too many times and I need help. 

(1) I have been exporting small sections of a larger model into Maya from Rhino as FBX. In Maya I rotate and scale the models (-90 in X, Scale XYZ 0.001). The Named Views are being saved, but do not have a successful import into the Maya model. They do not appear as in Rhino, and the problem is not solved by scaling or rotating the cameras.

(2) If I try going the other direction, the cameras exported from Maya as FBX are also not aligning with the model in Rhino as they are in Maya.. I will do my best to post some images of the problem and hope you can help. 

error !!

This is what the named views look like

here I am trying to the other way with a good view from Maya

strange placement..

This is the best result I can achieve, after I scale the camera by 1000 

Any Advice???

Thanks, Robert. 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service