KeyShot Forum

Technical discussions => Extending KeyShot => Scripting => Topic started by: mikekhogan on May 01, 2017, 12:50:05 AM

Title: Importing obj + setting good camera distance / lookat angle
Post by: mikekhogan on May 01, 2017, 12:50:05 AM
Hi all,

I'm a novice with both keyshot and python, but I have a project that requires:
1) Creating models programmatically in Blender
2) Importing models into Keyshot, setting good camera angles
3) Rendering the models in Keyshot

I've solved 1 and 3, but I'm still having problems with 2.

In short, I import the obj then:
- Use opts[snap to ground] and opts[center geometry] as true
- lux.setStandardView as either top or isometric

The problem is that this doesn't always guarantee a good camera angle. Sometimes the distance is too short or too far, or the camera is not panned correctly to provide a good shot.

Is there any programmatic way to ensure that the center of the PROJECTED mass - i.e. the 2d projection onto the camera, not the 3d object - is centered in the camera?

If there is any more info I can provide, please do let me know.
Title: Re: Importing obj + setting good camera distance / lookat angle
Post by: TpwUK on May 01, 2017, 02:43:52 AM
If you are setting up the camera view in Blender export as FBX and you can export the camera settings with the model.

Martin
Title: Re: Importing obj + setting good camera distance / lookat angle
Post by: mikekhogan on May 02, 2017, 12:21:14 AM
Hi TpwUK - thanks so much for your suggestion, it is indeed very useful. Much easier (for me at least) to do this stuff in Blender.