Pose export script for Blender 2.80

Post about creating and skinning models here
jlv
Site Admin
Posts: 14912
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Pose export script for Blender 2.80

Post 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
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Jeremy150
Posts: 3324
Joined: Mon Jul 30, 2012 9:56 am
Team: MV Films

Re: Pose export script for Blender 2.80

Post by Jeremy150 »

Any limit/goal you have in mind for bone count, and animation length?
Image
jlv
Site Admin
Posts: 14912
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Pose export script for Blender 2.80

Post 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.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Smidly
Crushed Dissenter
Posts: 330
Joined: Wed May 30, 2018 2:56 am
Team: Wildside
Location: JLV's Basement

Re: Pose export script for Blender 2.80

Post by Smidly »

Thanks dawg this should make things much easier
Motospun
Posts: 111
Joined: Thu Aug 23, 2018 6:44 pm
Location: Canada

Re: Pose export script for Blender 2.80

Post by Motospun »

koob
DJ99X
Posts: 15523
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: Pose export script for Blender 2.80

Post 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.

aeffertz
Posts: 4029
Joined: Sat Sep 06, 2014 7:01 am
Team: Studio ATE
Location: Wiscansin

Re: Pose export script for Blender 2.80

Post by aeffertz »

Those are the sickest dance moves I have ever seen.
Image
jlv
Site Admin
Posts: 14912
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Pose export script for Blender 2.80

Post 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.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
VUSTTOS
Posts: 837
Joined: Sun Jan 17, 2016 2:02 am
Team: Spanish MX Gamers
Location: GPS not working

Re: Pose export script for Blender 2.80

Post 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?
Alex V111#1017
Image
DJ99X
Posts: 15523
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: Pose export script for Blender 2.80

Post 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
jlv
Site Admin
Posts: 14912
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Pose export script for Blender 2.80

Post 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.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
jlv
Site Admin
Posts: 14912
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Pose export script for Blender 2.80

Post 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
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
sethypeety
Posts: 326
Joined: Mon Jul 18, 2016 2:51 pm
Team: SpitFire Aprilia
Location: in your face
Contact:

Re: Pose export script for Blender 2.80

Post by sethypeety »

Any chance we could get a tutorial or something on how to use this stuff correctly?
Image
jlv
Site Admin
Posts: 14912
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Pose export script for Blender 2.80

Post 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?
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
sethypeety
Posts: 326
Joined: Mon Jul 18, 2016 2:51 pm
Team: SpitFire Aprilia
Location: in your face
Contact:

Re: Pose export script for Blender 2.80

Post 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.
Image
Post Reply