Pose export script for Blender 2.80

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

Pose export script for Blender 2.80

Postby jlv » Tue Oct 29, 2019 3:04 am

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.

User avatar
Jeremy150
Posts: 2262
Joined: Mon Jul 30, 2012 9:56 am
Team: MV Films

Re: Pose export script for Blender 2.80

Postby Jeremy150 » Tue Oct 29, 2019 5:24 am

Any limit/goal you have in mind for bone count, and animation length?
Image

jlv
Site Admin
Posts: 13783
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Pose export script for Blender 2.80

Postby jlv » Wed Oct 30, 2019 1:53 am

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.

User avatar
Smidly
Crushed Dissenter
Posts: 330
Joined: Wed May 30, 2018 2:56 am
Team: WildSide Designs
Location: JLV's Basement

Re: Pose export script for Blender 2.80

Postby Smidly » Sun Nov 03, 2019 3:30 am

Thanks dawg this should make things much easier

User avatar
Motospun
Posts: 64
Joined: Thu Aug 23, 2018 6:44 pm
Team: Swapmotolive.com
Location: Canada |:

Re: Pose export script for Blender 2.80

Postby Motospun » Sun Nov 03, 2019 4:09 am

koob

User avatar
DJ99X
Posts: 15522
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: Pose export script for Blender 2.80

Postby DJ99X » Wed May 20, 2020 12:15 pm

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.


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

Re: Pose export script for Blender 2.80

Postby aeffertz » Thu May 21, 2020 12:21 am

Those are the sickest dance moves I have ever seen.
Image

jlv
Site Admin
Posts: 13783
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Pose export script for Blender 2.80

Postby jlv » Thu May 21, 2020 1:18 am

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: 809
Joined: Sun Jan 17, 2016 2:02 am
Team: Spanish MX Gamers
Location: GPS not working

Re: Pose export script for Blender 2.80

Postby VUSTTOS » Thu May 21, 2020 1:53 am

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?
Image

User avatar
DJ99X
Posts: 15522
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: Pose export script for Blender 2.80

Postby DJ99X » Thu May 21, 2020 7:04 am

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: 13783
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Pose export script for Blender 2.80

Postby jlv » Fri May 22, 2020 1:53 am

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: 13783
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Pose export script for Blender 2.80

Postby jlv » Sat Sep 05, 2020 1:23 am

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.


Return to “Model and Skin Editing”

Who is online

Users browsing this forum: No registered users and 42 guests