Author Topic: Script for rendering deformable meshes  (Read 19560 times)

0 Members and 1 Guest are viewing this topic.

Offline hstokholm

  • Developer
  • Newbie
  • *****
  • Posts: 37
Script for rendering deformable meshes
« 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

Offline Esben Oxholm

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 1655
  • esbenoxholm.dk/keyshot-video-course
    • Freelance CG Artist
Re: Script for rendering deformable meshes
« Reply #1 on: December 10, 2015, 06:21:02 am »
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?

Offline TpwUK

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 2910
Re: Script for rendering deformable meshes
« Reply #2 on: December 10, 2015, 06:36:55 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

Offline hstokholm

  • Developer
  • Newbie
  • *****
  • Posts: 37
Re: Script for rendering deformable meshes
« Reply #3 on: December 10, 2015, 06:48:35 am »
Nice!

Is it possible to activate motion blur on these?

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

Offline Esben Oxholm

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 1655
  • esbenoxholm.dk/keyshot-video-course
    • Freelance CG Artist
Re: Script for rendering deformable meshes
« Reply #4 on: December 10, 2015, 06:49:48 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.

Offline evilmaul

  • Sr. Member
  • ****
  • Posts: 418
Re: Script for rendering deformable meshes
« Reply #5 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?

Offline Artur

  • Jr. Member
  • **
  • Posts: 69
Re: Script for rendering deformable meshes
« Reply #6 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.

Thanks in advance.

Offline hstokholm

  • Developer
  • Newbie
  • *****
  • Posts: 37
Re: Script for rendering deformable meshes
« Reply #7 on: December 15, 2015, 04:38:57 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.

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?

Offline Artur

  • Jr. Member
  • **
  • Posts: 69
Re: Script for rendering deformable meshes
« Reply #8 on: December 15, 2015, 06:18:42 am »
Sorry for the recurrent request but maybe a step by step guide:

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

Offline hstokholm

  • Developer
  • Newbie
  • *****
  • Posts: 37
Re: Script for rendering deformable meshes
« Reply #9 on: December 15, 2015, 07:04:56 am »
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.



Offline reidsl

  • Newbie
  • *
  • Posts: 3
Re: Script for rendering deformable meshes
« Reply #10 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?

Offline redcode

  • Newbie
  • *
  • Posts: 4
Re: Script for rendering deformable meshes
« Reply #11 on: March 06, 2016, 02:14:36 pm »
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.

Offline hstokholm

  • Developer
  • Newbie
  • *****
  • Posts: 37
Re: Script for rendering deformable meshes
« Reply #12 on: March 07, 2016, 02:14:21 am »
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)

Offline dennisvolkerts

  • Newbie
  • *
  • Posts: 9
Re: Script for rendering deformable meshes
« Reply #13 on: June 23, 2016, 05:00:28 pm »
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
« Last Edit: June 23, 2016, 05:17:23 pm by dennisvolkerts »

guest84672

  • Guest
Re: Script for rendering deformable meshes
« Reply #14 on: June 23, 2016, 05:45:28 pm »
what version of KeyShot are you using? Make sure that you are on the latest version 6.2.85. It was just released.