How to automatically render a list of STEP files ?

Started by SebastianG, February 08, 2021, 05:59:18 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

SebastianG

I have a lot of assemblies in Onshape, that I want to import as step and render in KeyShot.
My customer wants a small rendering of each assembly for their website.

Manual steps I want to automate:

Import next Step file in the list.
1. Drag the materials on the parts
2. Set rounded edges to 0.2mm
3. Fit camera to model
4. Render still picture and save it with the name of the Step file

Repeat with next Step file...

I guess I should create a material template to select the materials according to the specific RGB values of the bodies.

What is the best approach to do something like that? With scripting? Can I automate KeyShot with another program?

INNEO_MWo

#1
Round edges is not supported via scripting. All the other stuff can be realized with the scripting console. Start KeyShot via batch, execute the script with every file in a folder, collect the render jobs in the queue or render results on demand.

The render images script is a good start. But it needs some work for camera settings, center and fit some nodes and manage output (path and naming).


The script language is Python. You don't a need 3rd party software to drive an automation.

SebastianG

Thanks for the reply! The scripting is the solution I was looking forward to.
I start with the render images script. 

I found this article:
https://blog.keyshot.com/keyshot-scripting-tutorial-automate-your-rendering

I  had to add the import option:
importOptions['separate_materials'] = False

Now it works with my Material Template, which was set up to with specific colors of the step geometry.

I will go through the Toytrain example to set up the camera, environment, ...
This will be a great time saver for me  :)