STEAM-GRUPPE
Blender Source Tools BleST
STEAM-GRUPPE
Blender Source Tools BleST
351
I SPIL
2,009
ONLINE
Grundlagt:
8. november 2013
Alle diskussioner > Help > Trådoplysninger
Rectus 6. jan. 2020 kl. 13:26
[Feature request] Additional Source 2 DMX Vertex parameters
There seems to be some undocumented DmeVertexData keywords used by Source 2 in DMX version 22.

The ones I could find were:
tangent$0
texcoord$1
speed$0
cloth_enable$0

I got the texcoord$1 and cloth_enable$0 attributes working by pasting in per-vertex values for them into a text mode DMX mesh file. It would be nice to be able to set them in BST.

texcoord$1 is simply a second UV map which can be used in the SteamVR Home shaders for AO/lightmaps or transparency.

cloth_enable$0 is a float value between 0 and 1 which is used to enable per-vertex cloth physics. Not sure if Blender has any interface for editing per-vertex floats, so it might be best to import/export the values as vertex colors so it can be painted.

Old versions of the model editor help files mention some other cloth attributes too, I'll have to look if I can find keywords for them.

Here is a working DMX file, not sure if everything is coorect though:
https://gist.github.com/Rectus/23cefc438730e336d3cfe4909b668dcb
< >
Viser 1-6 af 6 kommentarer
Zappy 7. jan. 2020 kl. 5:11 
Oprindeligt skrevet af Rectus:
- Not sure if Blender has any interface for editing per-vertex floats, -
It does, being vertex groups or such.

While primarily used to rig mesh to an armature (at least when it comes to Source stuff), they can also be used for other purposes (such as setting how much "left" or "right" specific vertices are when it comes to stereo shape keys for DMX exports for Source, or what the per-vertex value of "cloth_enable$0" should be for DMX exports for Source 2).
Sidst redigeret af Zappy; 7. jan. 2020 kl. 5:12
Rectus 7. jan. 2020 kl. 6:32 
Oprindeligt skrevet af Zappy:
It does, being vertex groups or such.

While primarily used to rig mesh to an armature (at least when it comes to Source stuff), they can also be used for other purposes (such as setting how much "left" or "right" specific vertices are when it comes to stereo shape keys for DMX exports for Source, or what the per-vertex value of "cloth_enable$0" should be for DMX exports for Source 2).

You're absolutely right. I completely forgot you could do more with vertex groups than rigging.

Probably better to add it there in that case.
Artfunkel 7. jan. 2020 kl. 10:44 
I've tried to use cloth_enable in the past but never had any luck. What effect does it have? (I don't have access to a Windows machine at home right now.)
Rectus 7. jan. 2020 kl. 14:53 
With the default .vmdl settings it generates a cloth node and bone on every vertex above a threshold value (0.05 by default). It also pins and limits the rotation fo any cloth nodes on vertices connected to non-cloth vertices. So if it's set up right, is should add cloth physics that "just works".

https://i.imgur.com/lq9Du4y.png
https://i.imgur.com/sfbgXUl.png

They seemed to update the cloth physics in the latest engine update, at least for SteamVR Home. Cloth can now collide with arbirtary geometry (and also there is a new bug that makes it sleep when the regular physics does).

I have no idea if adding cloth_enable to a DMX file has had any effect before, since all the old help text for the model editor mention it being authored in maya, which I'd guess uses some intenal FBX export plugin.


It is also possible to make a a cloth proxy mesh instead, that uses its vertices for the cloth nodes and maps onto the render mesh. It generates a compiled uneditable cloth mesh, and I couldn't find any way of pinning the cloth to anything so it wouldn't just fall to the ground.

The third way whiich I've been using up until now is the Add Cloth Piece command from the physics right click menu. That allows you to use the existing armature to set up cloth manually, and has a ton of undocumented settings so it's kinda a pain to use.

Old version of the same table:
https://i.imgur.com/m4uZsyR.png
https://twitter.com/rectus_sa/status/1207928128007557122
Rectus 12. jan. 2020 kl. 14:34 
I found some more cloth attributes:
cloth_animation_attract cloth_animation_force_attract cloth_goal_strength cloth_goal_strength_v2 cloth_goal_damping cloth_drag cloth_drag_v2 cloth_mass cloth_gravity cloth_gravity_z cloth_collision_radius cloth_ground_collision cloth_ground_friction cloth_use_rods cloth_make_rods cloth_anchor_free_rotate cloth_volumetric cloth_suspenders cloth_bend_stiffness cloth_stray_radius_inv cloth_stray_radius cloth_stray_radius_stretchiness cloth_antishrink cloth_shear_resistance cloth_stretch cloth_friction cloth_collision_layer_0 - 15 cloth_vertex_set_ Probably looks for user supplied postfixes, not 100% sure
(They need the $0 postfix for the DMX keywords)

I think these are all float valued. It is possible there are global parameters as well, but I haven't looked into it yet.

I added some basic export support to BST, with the attributes set with vertex groups. Unfortunately some of the values don't seem to be normalized between 0 and 1, so it's not possible to set the full range of values with vertex groups. Not sure if that is doable without adding some kind of custom interface.
https://github.com/Artfunkel/BlenderSourceTools/pull/7
Rectus 18. jan. 2020 kl. 8:51 
Oprindeligt skrevet af Rectus:
So if it's set up right, is should add cloth physics that "just works".

Whoops, missed a thing to get it working. By default the .vmdl has a hidden property that foreces it to use cloth procxy meshes only.

If you open the .vmdl, go to m_clothProxyMeshList and set the property m_bDriveMeshesWithBacksolvedJointsOnly to false, it will generate cloth from attributes on the reference mesh.
Sidst redigeret af Rectus; 18. jan. 2020 kl. 8:51
< >
Viser 1-6 af 6 kommentarer
Per side: 1530 50

Alle diskussioner > Help > Trådoplysninger
Dato opslået: 6. jan. 2020 kl. 13:26
Indlæg: 6