Importing multiple models in one go

Started by pookster, March 20, 2017, 05:03:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pookster

Hi everyone. I am new to the forum (although I've been using Keyshot for a month now). I am importing around 200 smaller models into Keyshot and combining it into one large model. Each model takes approx 30 seconds to 1 minute to import. So I have to sit around waiting for each model to import and then go drag and drop the next model into the scene. It would be much faster if I could just shift + select as many models (DWG files) as I want in one go and Keyshot just runs for as long as it takes to import all of them. So I could do that during a lunch break rather than sit around for over 2 hours importing files one by one. I couldn't see any obvious way to do this. Even if there was some script to achieve this, it would save me a lot of time.

Any help is much appreciated. In the meantime, I better start importing another 100 files :- (

Thanks
pookster   

mattjgerard

You might be better off using a different 3d software to import all the models into, and then output that for keyshot. I use cinema 4d, and I could very easily import many many different files into one project, then use the KS plugin to export a bip file for KS. The layering and hierarchy would stay the same as well, so any organizing I did in C4D would make the transition.

I don't know blender very well at all, but its free, and there might be some efficiency in using Blender to do your imports, then export to a certain file format to get into Keyshot.

pookster

Thanks fr that mattjgerard. Since there are no more responses, I am assuming the above method is the only way. I did sit all day yesterday from 5.00 pm to 12.00 pm importing 180 drawings into KS. Then the file decided to crash when I tried to cancel importing one wrong file. So now I am going to try using some other piece of 3rd party software to import blocks of drawing into larger files and import into KS. It's just a pain. The good thing is that KS handles tons of data.

The problem that comes after that is organising the materials on all these drawings. KS imports every layer in each DWG as a separate material. So I have to manually combine the same layers into the same material so that I can change material on all those same layers in one go. I wish the scene list view can list by layers in addition to the Models list. Then allow me to make new groups with each group holding all the same layers from all the 200 drawings and be able to apply materials to the group (of layers). I think that should be posted as another topic really.

DriesV

Hey Pookster,

Batch import can be automated through scripting. Do you have a KeyShot 6 Pro license?
It is fairly straightforward to do and would make your life a lot easier.  :)

Dries

pookster

Hi DriesV, I do have a Pro license. Could you let me know how to create a script? Or point to some help on how to make one? I will wait for that to work before importing again. Don't want to sit for another 6 hrs straight : -)

Chad Holton


pookster

Quote from: Chad Holton on March 21, 2017, 08:24:44 AM
Hi Pookster,

Here's a good place to start: https://keyshot.com/scripting/doc/6.0/quickstart.html

Hope this helps.

Chad

Thanks Chad. I have already stumbled upon that one and looking at a few other examples. I was hoping that someone would have already written one or already available in some script library on Keyshot forum. I am still looking. I am not so familiar with scripting. I guess I should be able to learn if I sit on it for a while though.

mattjgerard

I'm in the same boat, I see so much potential for scripting, but its just out of my mental reach to understand the syntax. I'd be willing to toss someone some dollars to hack together some scripts if it came down to it.

Might have to look into some python classes.

DriesV

I would also like to point out that we have a blog post on scripting.
https://blog.keyshot.com/keyshot-scripting-tutorial-automate-your-rendering

The zip package there contains a sample project, complete with step-by-step scripts. It is a good resource to learn what the different functions do, using a practical example. The first script is very basic. With each step new functions or optimizations are added.

In fact, you could use parts of this script as a basis for what you want to do, since it also does batch import.

My first tip would be to draw/write the basic logic of what a script should do.
E.g.:

  • Load folder with DWG files.
  • Set Import settings.
  • Import models.
etc.

Dries

pookster

Quote from: DriesV on March 21, 2017, 05:02:26 PM
I would also like to point out that we have a blog post on scripting.
https://blog.keyshot.com/keyshot-scripting-tutorial-automate-your-rendering

The zip package there contains a sample project, complete with step-by-step scripts. It is a good resource to learn what the different functions do, using a practical example. The first script is very basic. With each step new functions or optimizations are added.

In fact, you could use parts of this script as a basis for what you want to do, since it also does batch import.

My first tip would be to draw/write the basic logic of what a script should do.
E.g.:

  • Load folder with DWG files.
  • Set Import settings.
  • Import models.
etc.

Dries

I used the Import 3.py from your sample (the train samples) set and just modified it to read DWG instead of STEP. That seems to work. I don't really understand exactly what the codes does but it somewhat made sense and works now. So that saves me a lot of time. I need to work out how to change model scale to 1 (it imports as millimeters as 0.001 scale). But that's just 5 min job to go through all the models one by one. I have set it running now and seems to work. Will know if there is any issue after it imports everything. But should be OK.

Thanks for the help.