STEAM GROUP
Blender Source Tools BleST
STEAM GROUP
Blender Source Tools BleST
209
IN-GAME
1,272
ONLINE
Founded
November 8, 2013
All Discussions > Help > Topic Details
The303 Jul 6, 2018 @ 10:45pm
Unrigged Meshes to have auto Nodes in one SMD exporting? (Very useful for physics sim)
I want to know how (or request an option if not possible currently) to export separate unrigged meshes as nodes in one SMD just like in 3ds exporting. Currently the only way ive found is a painful process of creating a bone for each piece with a constraint.

Now I have found a hacky workaround to get Baked blender physics sim into Source or GoldSrc models: I exported my simulaton as an ASCII 6.0FBX with "animation optimization" turned off and then imported into another modelling program called fragMOTION which at some point turned all these loose meshes into node objects. It also kept the heiarchy that i parented in blender for the meshes, but now they have nodes.

Having to skip the export to another program would save a buch of steps and other software needed. Also, here is how my current method is done:
http://the303.org/imaeg/blender_wallphys.jpg
Last edited by The303; Jul 6, 2018 @ 10:45pm
Originally posted by Artfunkel:
Right, I see what you want now. This scene is set up incorrectly for skeletal animation export. You need one armature with a bone for each brick, and one animation of that armature. (If you were targeting Source I would tell you to create a vertex animation and save all of this bother, but that's not supported in GoldSrc.)

I wrote a script to create all of the bones you need and add constraints to them:

import bpy for ob in bpy.data.objects: if ob.name.startswith("b"): bpy.ops.armature.bone_primitive_add() bpy.context.active_object.data.edit_bones[-1].name = ob.name bpy.ops.object.mode_set(mode='POSE') for bone in bpy.context.active_object.pose.bones: con = bone.constraints.new('COPY_TRANSFORMS') con.target = bpy.data.objects[bone.name]

You'll need to create an armature, enter edit mode on it, and delete the starting bone Blender made for you before running that script.

There is work to do beyond that point. You'll need to play back the animation and capture it as bone keyframes; then remove the bone constraints; then add an armature modifier and vertex group (named after a bone) to each brick. At that point the bricks will be following the bones instead of vice versa and the animation export should start to work correctly.

You may prefer to keep doing the workaround instead!
< >
Showing 1-7 of 7 comments
Artfunkel Jul 7, 2018 @ 6:01am 
Add them to a group.
The303 Jul 7, 2018 @ 10:56am 
When I tried exporting the group but everything was skinned to only on 1 node object in the SMD (need wall, brick1,2,3,ect). Also in group exportable list I couldn't export the animation sequence it seemed, only mesh.
Artfunkel Jul 8, 2018 @ 2:01am 
I don't understand what you mean. SMD doesn't support multiple sub-objects, it just merges them all into one.

Are you trying to create bodygroups?
The303 Jul 8, 2018 @ 12:20pm 
"Are you trying to create bodygroups?"
No, I'm trying to get each mesh to export in a way so each mesh has its own node. When I export there is only 1 node/bone object. Heres a pic:
http://the303.org/imaeg/smd_nodes_export.png
On the left is what the SMD I need should look like with all meshnodes (this example I could only create by exporting out of fragmotion from FBX from blender -that hacky thing I am doing in the meantime). On the right is what SMD exporting right out of blender BST does, as you can see it writes all meshes to skin to 1 node.

If you need, Ive packed up my blend file with all sources and in the "fragmotion" folder is the fully compiled working models GoldSrc & Source engine models from that fragmotion export:
http://the303.org/stuff/baked_physics_blend.rar
Last edited by The303; Jul 8, 2018 @ 12:22pm
A moderator of this forum has indicated that this post answers the original topic.
Artfunkel Jul 9, 2018 @ 6:39am 
Right, I see what you want now. This scene is set up incorrectly for skeletal animation export. You need one armature with a bone for each brick, and one animation of that armature. (If you were targeting Source I would tell you to create a vertex animation and save all of this bother, but that's not supported in GoldSrc.)

I wrote a script to create all of the bones you need and add constraints to them:

import bpy for ob in bpy.data.objects: if ob.name.startswith("b"): bpy.ops.armature.bone_primitive_add() bpy.context.active_object.data.edit_bones[-1].name = ob.name bpy.ops.object.mode_set(mode='POSE') for bone in bpy.context.active_object.pose.bones: con = bone.constraints.new('COPY_TRANSFORMS') con.target = bpy.data.objects[bone.name]

You'll need to create an armature, enter edit mode on it, and delete the starting bone Blender made for you before running that script.

There is work to do beyond that point. You'll need to play back the animation and capture it as bone keyframes; then remove the bone constraints; then add an armature modifier and vertex group (named after a bone) to each brick. At that point the bricks will be following the bones instead of vice versa and the animation export should start to work correctly.

You may prefer to keep doing the workaround instead!
Last edited by Artfunkel; Jul 9, 2018 @ 6:45am
The303 Jul 9, 2018 @ 11:13am 
Ah, I see. Thanks for the help. Yeah In *my* case Ill probably keep using my workaround but I think others can take a look at this. Can I quote you for a tutorial Im writing on this bakedphys script method?
Artfunkel Jul 9, 2018 @ 11:43am 
Of course.
< >
Showing 1-7 of 7 comments
Per page: 1530 50

All Discussions > Help > Topic Details
Date Posted: Jul 6, 2018 @ 10:45pm
Posts: 7