Pose export script for Blender 2.80
Pose export script for Blender 2.80
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
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.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Re: Pose export script for Blender 2.80
Any limit/goal you have in mind for bone count, and animation length?
Re: Pose export script for Blender 2.80
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.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
-
- 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
Thanks dawg this should make things much easier
Re: Pose export script for Blender 2.80
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
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.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
-
- 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
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
Re: Pose export script for Blender 2.80
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
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.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?
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.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Re: Pose export script for Blender 2.80
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
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.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
-
- Posts: 337
- Joined: Mon Jul 18, 2016 2:51 pm
- Team: SpitFire Aprilia
- Location: in your face
- Contact:
Re: Pose export script for Blender 2.80
Any chance we could get a tutorial or something on how to use this stuff correctly?
Re: Pose export script for Blender 2.80
Anything in particular or the whole process from model to script?sethypeety wrote:Any chance we could get a tutorial or something on how to use this stuff correctly?
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.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
-
- Posts: 337
- Joined: Mon Jul 18, 2016 2:51 pm
- Team: SpitFire Aprilia
- Location: in your face
- Contact:
Re: Pose export script for Blender 2.80
The whole thing, my experience with blender is very limited.jlv wrote:Anything in particular or the whole process from model to script?sethypeety wrote:Any chance we could get a tutorial or something on how to use this stuff correctly?