STEAM-GRUPPE
Blender Source Tools BleST
STEAM-GRUPPE
Blender Source Tools BleST
192
I SPILL
1,377
TILKOBLET
Opprettet
8. november 2013
Alle diskusjoner > Help > Emnedetaljer
The303 6. juli 2018 kl. 22.45
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
Sist redigert av The303; 6. juli 2018 kl. 22.45
Opprinnelig skrevet av 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!
< >
Viser 17 av 7 kommentarer
Artfunkel 7. juli 2018 kl. 6.01 
Add them to a group.
The303 7. juli 2018 kl. 10.56 
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 8. juli 2018 kl. 2.01 
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 8. juli 2018 kl. 12.20 
"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
Sist redigert av The303; 8. juli 2018 kl. 12.22
En moderator for dette forumet markerte dette innlegget som svar på det opprinnelige emnet.
Artfunkel 9. juli 2018 kl. 6.39 
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!
Sist redigert av Artfunkel; 9. juli 2018 kl. 6.45
The303 9. juli 2018 kl. 11.13 
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 9. juli 2018 kl. 11.43 
Of course.
< >
Viser 17 av 7 kommentarer
Per side: 1530 50

Alle diskusjoner > Help > Emnedetaljer
Dato lagt ut: 6. juli 2018 kl. 22.45
Innlegg: 7