KeyShot Forum

Technical discussions => Extending KeyShot => Scripting => Topic started by: zachbeale on January 26, 2016, 01:28:39 PM

Title: OBJ Sequence Import
Post by: zachbeale on January 26, 2016, 01:28:39 PM
Hello,

I don't really understand Python yet, but I'm looking to import a sequence of about 330 OBJs I just finished processing in Zbrush, in order to create an animation.

I know it can be done, as I've seen that other keyshot users have done it, I'm just unable to find a script. Any help you can give would be greatly appreciated.
Title: Re: OBJ Sequence Import
Post by: TpwUK on January 26, 2016, 01:55:04 PM
Here's my basic one, if you can get your head round python you can soon customised it to your needs

Martin
Title: Re: OBJ Sequence Import
Post by: zachbeale on January 26, 2016, 02:06:45 PM
I remember coming across your facebook page while googling for this, so I think I know which video of yours this ended up being used for. Small internet.

This is pretty much what I need, but is there a way to bring the OBJs in, and sequence them, like in a timeline, so I can assign materials to them from within keyshot? Or will I need a script that renders each layer in keyshot (meaning each OBJ, I suppose) individually?
Title: Re: OBJ Sequence Import
Post by: TpwUK on January 26, 2016, 04:39:45 PM
Quote from: zachbeale on January 26, 2016, 02:06:45 PM
I remember coming across your facebook page while googling for this, so I think I know which video of yours this ended up being used for. Small internet.

This is pretty much what I need, but is there a way to bring the OBJs in, and sequence them, like in a timeline, so I can assign materials to them from within keyshot? Or will I need a script that renders each layer in keyshot (meaning each OBJ, I suppose) individually?

If i remember rightly that script brings each obj one at once so no timeline support, but it's set so you import frame.000 to setup materials and then you run the script as it will retain the materials ready for frame.00x to frame.xxx ... Read through the script. I did do a more complex one but i can't find it on any of my drives so i think it got killed with a recentish hdd failure :(

Martin
Title: Re: OBJ Sequence Import
Post by: zachbeale on January 27, 2016, 08:57:32 AM
Hmm, I see.

Maybe the overall effort would be simpler if the script was just going through a list of groups, within a larger group, and toggling each groups visibility then rendering. That way I can generate frames without a timeline.

As it stands, I've got each obj in keyshot as a separate group.
Title: Re: OBJ Sequence Import
Post by: DriesV on August 07, 2016, 11:14:06 AM
Attached is a script I made to render a sequence of bip or obj files.
It support retaining materials and updating animation frames (should any animations exist in the scene).

For both bip and obj, this script assumes that you import the first frame to do the material and scene setup.
The only input this script needs is a folder with sequenced bip or obj files. You specify 'bip' or 'obj' via a dropdown box.

Have fun!  :)

Dries
Title: Re: OBJ Sequence Import
Post by: JMAHIEDDINE on August 25, 2016, 05:09:46 AM
Thanks a lot DriesV, could you please make a quick tuto video of how to implement this ?(or at least a series of step by step pictures).
I'm not very familiar with pyton script, so as many others, so it would really be much appreciated :)

I have a couple of questions thow :
- what if an object appear in the scene at a time, do we need to stop rendering the scene at this precise time and render the other part with the object in it ? (by this I mean render the first frame of the scene with the object and animate it by importating the obj sequence)
- Could it be possible to import the complete obj sequence directly, then create a bip file and start to apply materials?
- I never try to export obj sequence from maya, but is it possible to end up with very complex scene this way?

Thanks a lot for your time and sorry for all those questions. I'm just very enthusiast about it, as I'm stuggling with fbx files since a year now without much success.

cheers,
John
Title: Re: OBJ Sequence Import
Post by: Solid on September 07, 2016, 10:39:03 AM
Very nice script DriesV!

I have one question regarding the script. is there any way to increase the render quality of the images in the queue? The render quality is very low when i use the obj sequence import script.

Title: Re: OBJ Sequence Import
Post by: Solid on September 08, 2016, 12:17:44 PM
The normals dont get calculated when this script imports the .obj. Is there a way to add that to the script somehow?
Title: Re: OBJ Sequence Import
Post by: Solid on September 09, 2016, 10:16:48 AM
Add the following line    io['compute_normals'] = True    to the script and it will calculate the normals.