0

I used Blender today to create a turntable animation for very simple model that I made and intend to 3D print. I've found that such animations are very effective for communicating the shape of a model and I'd like to be able to rapidly generate ones like the one below.

an example turntable animation

I'm very comfortable with Python, but haven't used Blender's Python scripting API much as yet, and there's a significant learning curve to Blender itself, let alone using it programmatically, and I don't want to assume I'm on the right track.

The process I used today, and the one imagine trying to automate is something like so:

  1. Create new blend-file
  2. Remove default cube
  3. Import an STL
    • It would be great if I could somehow specify this via the command line, as that would potentially let me run batches or tie it to another application
  4. Set STL's origin to be its center of volume
  5. Set a camera to track the STL's origin
  6. Auto-fit a camera view to the object.
    • I have no idea how to do this, and when I did my render today, I just toyed with the camera position and properties until it was about right. It was... very finicky.
  7. Create/move a light to some position, probably camera high and left.
  8. Insert keyframes at frames 0 and 250 to rotate the object
    • Total frames should probably another command line parameter, if possible.
  9. Trigger a render

In summary:

  • Is this a rational process to create this animation, or is there something much easier?
  • Assuming these steps make sense, what is a good way that I can automate them? Python? Something else?

Related:

This is arguably a duplicate of python - Auto turntable animation, but I'm trying to ask both about the process and whether Python or something else (!) is the right way to make it minimally painful.

William
  • 101
  • 2
  • 1
    One easier approach is to have a template file that already contains a camera set up with a follow path constraint on a circle and also the lighting you want to use. You can have the path animated in this template. That only leaves importing the STL, positioning it at the origin and scaling it to fit the camera frame before running a render. That bit could be automated in Python. On the other hand, you can automate the whole process. There are questions here that cover pretty much each step as you've described them. – Marty Fouts Jun 08 '22 at 19:34
  • @MartyFouts - It sounds like what I'm doing doesn't seem unnecessarily complicated, then? – William Jun 09 '22 at 13:56
  • 1
    You are doing what you have to do if you want to start from scratch. So yes, not unnecessarily complicated. Also, except for step 6, pretty straightforward steps. 6 involves creating a viewing frustum and placing the camera at its apex; but once you get the math down it should be easy to implement. – Marty Fouts Jun 09 '22 at 14:36

0 Answers0