Page 1 of 2

Pose export script for Blender 2.80

Posted: Tue Oct 29, 2019 3:04 am
by jlv
This script will export a sequence of poses as a Javascript object for use in scripts.

https://mxsimulator.com/scripts/json_pose_export.py

1. Download via Right click, Save link as.
2. In Blender, open Edit / Preferences.
3. Go to Addons and click "Install...".
4. Find "json_pose_export.py" and click "Install Add-on from File...".
5. Find "Import-Export: Export Pose as JSON" in the list and check it to enable the add on.

Here's a complete example with track and blend file included. To export the poses, use "export JSON pose" in Blender's export menu and then copy the resulting file into the frills.js file after the "Begin pose exported from flagger.blend" comment.

flaggertest.zip

Re: Pose export script for Blender 2.80

Posted: Tue Oct 29, 2019 5:24 am
by Jeremy150
Any limit/goal you have in mind for bone count, and animation length?

Re: Pose export script for Blender 2.80

Posted: Wed Oct 30, 2019 1:53 am
by jlv
No limit for the length. The bone count limit is set to 32, but there's currently a bug with more than 16 which could crash the game. I forgot to update a buffer for the larger size. It'll be fixed in the next snapshot.

Re: Pose export script for Blender 2.80

Posted: Sun Nov 03, 2019 3:30 am
by Smidly
Thanks dawg this should make things much easier

Re: Pose export script for Blender 2.80

Posted: Sun Nov 03, 2019 4:09 am
by Motospun
koob

Re: Pose export script for Blender 2.80

Posted: Wed May 20, 2020 12:15 pm
by DJ99X
Finally got around to trying this script out. Works great! I had modified the code to interpolate between keyframes to smooth the motion out, but I had other incomplete stuff in the script, so I didn't apply it to this trial.


Re: Pose export script for Blender 2.80

Posted: Thu May 21, 2020 12:21 am
by aeffertz
Those are the sickest dance moves I have ever seen.

Re: Pose export script for Blender 2.80

Posted: Thu May 21, 2020 1:18 am
by jlv
Good eye on the interpolation. I was planning on that myself but figured it didn't look that choppy and I really wanted to get this posted.

Re: Pose export script for Blender 2.80

Posted: Thu May 21, 2020 1:53 am
by VUSTTOS
That script x20 flaggers in a national track, will make the fps drop down a bit? Or it's something that it's well optimized?

Re: Pose export script for Blender 2.80

Posted: Thu May 21, 2020 7:04 am
by DJ99X
I wouldn't think the animation part would add too much. The model itself would just need to be optimised with lods like you wouldn't any other model. If the animation did have any impact, you could easily halt the animation based on flagger distance from the camera

Re: Pose export script for Blender 2.80

Posted: Fri May 22, 2020 1:53 am
by jlv
VUSTTOS wrote:That script x20 flaggers in a national track, will make the fps drop down a bit? Or it's something that it's well optimized?
Since it's interpreted code it's not optimal by definition, but it should be fast enough as long as it's not animating hundreds of objects. If it turns into a problem it'll be possible to just pose objects less often or based on distance like DJ said.

Re: Pose export script for Blender 2.80

Posted: Sat Sep 05, 2020 1:23 am
by jlv
Made some updates to the flaggertest example. Now has a starter and uses the new pose sequence cache. Already posted most of this in the snapshot topic but I've cleaned it up a bit since then.

https://mxsimulator.com/junk/flaggertest.zip

Re: Pose export script for Blender 2.80

Posted: Fri Oct 02, 2020 10:50 pm
by sethypeety
Any chance we could get a tutorial or something on how to use this stuff correctly?

Re: Pose export script for Blender 2.80

Posted: Sat Oct 03, 2020 12:47 am
by jlv
sethypeety wrote:Any chance we could get a tutorial or something on how to use this stuff correctly?
Anything in particular or the whole process from model to script?

Re: Pose export script for Blender 2.80

Posted: Sat Oct 03, 2020 6:10 am
by sethypeety
jlv wrote:
sethypeety wrote:Any chance we could get a tutorial or something on how to use this stuff correctly?
Anything in particular or the whole process from model to script?
The whole thing, my experience with blender is very limited.