Script for rendering deformable meshes

Started by hstokholm, December 10, 2015, 04:47:19 AM

Previous topic - Next topic

0 Members and 6 Guests are viewing this topic.

hstokholm

Attached is a script that supports rendering deformable meshes for Alembic and Maya files.

The workflow is as follows:

- Import first frame of the file. This is done through animation -> specific frame in the import dialog.

- Set up the scene with materials, environment, and camera.

- Run the script that continuously updates the geometry with the next frame and adds a image render to the queue.
If "Increase Keyshot frames" is checked the timeline in keyshot will also move each frame to allow for camera and material animations.

I tested it with the alembic octopus example file, and the result is attached.

- Heine

Esben Oxholm

Thanks for sharing Heine, and well described. Got it to work in one shot :)
Animation as alembic from modo 901:


Is it possible to activate motion blur on these?

TpwUK

Quote from: Esben Oxholm on December 10, 2015, 06:21:02 AM
Is it possible to activate motion blur on these?

I don't think you can Esben because you only have one frame in memory at any one time, although with ABC being a cache in theory you could manipulate things via scripting and somehow merge and fade previous render results to create a pseudo motion blur effect. Personally i think it would be easier to batch process the frames individually via PS or AE etc

Martin

hstokholm

Nice!

Quote from: Esben Oxholm on December 10, 2015, 06:21:02 AM
Is it possible to activate motion blur on these?

Unfortunately not. That can not be used for animations created through scripting.

Esben Oxholm

Quote from: TpwUK on December 10, 2015, 06:36:55 AM
Quote from: Esben Oxholm on December 10, 2015, 06:21:02 AM
Is it possible to activate motion blur on these?
I don't think you can Esben because you only have one frame in memory at any one time, although with ABC being a cache in theory you could manipulate things via scripting and somehow merge and fade previous render results to create a pseudo motion blur effect. Personally i think it would be easier to batch process the frames individually via PS or AE etc
Oh, yeah, true... Makes sense. Thanks for explaining.
Yup, the best then, I guess,  will be to apply some pseudo motion blur in AE.

evilmaul

thats sweet! thanks Heine!!
do you think this can be done differently in the future so that mblur can be applied to deformed objs as well?
As an alternative would make sense to output motion vectors as a map to then apply mbur in post?

Artur

Could anyone redirect me to a video tut for this one?
I am a novice in scripting for KS and I am trying to export a animation from C4D r 15 to KS6.

Thanks in advance.

hstokholm

Quote from: Artur on December 15, 2015, 12:42:30 AM
Could anyone redirect me to a video tut for this one?
I am a novice in scripting for KS and I am trying to export a animation from C4D r 15 to KS6.

Hi Artur.

I am afraid that a video tutorial isn't available currently.

If you have KeyShot 6 pro you are able to render the animation frames using scripting.
C4D r 15 should be able to export the animation to an alembic file (.abc) which can be used with this script.
To actually run the script you open the scripting console which are located in "Window -> Scripting Console" in the menu bar.
In the "Scripts" tab you have the option to import the script, and then it can be used by double clicking it.

If you have any specific questions feel free to ask.

Quote from: evilmaul on December 10, 2015, 11:26:23 AM
thats sweet! thanks Heine!!
do you think this can be done differently in the future so that mblur can be applied to deformed objs as well?
As an alternative would make sense to output motion vectors as a map to then apply mbur in post?

Good to hear it's useful. And yes it would make sense to support motion blur in the future. Maybe for now motion vectors can be output from maya and then combined in post?

Artur

Sorry for the recurrent request but maybe a step by step guide:

1- ...
2-...
3-...

hstokholm

No problem Artur.

1. Export from cinema 4d to an Alembic file.
2. Import first frame of the file. This is done through animation -> specific frame in the import dialog. 
3. Set up the scene as you want it with materials, environment, and camera.
4. Open the scripting console which are located in "Window -> Scripting Console" in the menu bar and choose the "scripts" tab.
5. Import the script "Add deformable mesh frames to queue.py", and then it can be used by double clicking it.
6. Fill out the options in the "Add deformable mesh frames to queue" dialog and press ok.
7. The geometry are now being updated for all frames, and a render is added to the queue for each frame.

Feel free to ask if anything is unclear.



reidsl

From the sound of it this is just me but Im having issues.  I ran the script fine, its the output that killing me.  First even though it shows that it saved to the correct folder in the output window, the files end up in my Keyshot Resources folder.  Second and most important, for some reason all of my files are .ext files (DeformerTEST.mb.00000.tif.ext) which make them worthless.  What am I doing wrong here?

redcode

Quote from: reidsl on January 08, 2016, 09:40:38 AM
From the sound of it this is just me but Im having issues.  I ran the script fine, its the output that killing me.  First even though it shows that it saved to the correct folder in the output window, the files end up in my Keyshot Resources folder.  Second and most important, for some reason all of my files are .ext files (DeformerTEST.mb.00000.tif.ext) which make them worthless.  What am I doing wrong here?

I'm having the same exact problem! The script runs fine (very fast) and then I get the files ending up in the KeyShot Resources folder and all the output files have the extension .ext and I can't open them. What is going on? Please let us know. I was very disappointed when I discovered KeyShot couldn't import deformation files from Maya or through FBX. This seemed like a passable workaround. Please help us.

hstokholm

The .ext files are for keyshots render queue. The scripts add all the renders to the render queue, and you then have to manually process the queue. (Render -> Queue -> Process Queue)

dennisvolkerts

#13
Quote from: hstokholm on December 10, 2015, 04:47:19 AM
Attached is a script that supports rendering deformable meshes for Alembic and Maya files.

The workflow is as follows:

- Import first frame of the file. This is done through animation -> specific frame in the import dialog.

- Set up the scene with materials, environment, and camera.

- Run the script that continuously updates the geometry with the next frame and adds a image render to the queue.
If "Increase Keyshot frames" is checked the timeline in keyshot will also move each frame to allow for camera and material animations.

I tested it with the alembic octopus example file, and the result is attached.

- Heine
Thnx for the script but it keeps crashing... is there some option in the script to keep it going? after 8 frames it seams to crash... i7 - 24 RAM, Nvidia Quadro K2100M (4GB)
my mesh count isnt that high...
5 mil poligons..
One character is animating.
abc file is 1.46GB

Can you add a option for maximum ram?
Or do you know some online scripts that can handle it?
obj sequence I heart about, this is the first I tried and I preffer alembic
thnx

guest84672

what version of KeyShot are you using? Make sure that you are on the latest version 6.2.85. It was just released.