merge ws/blendrig2
This commit is contained in:
commit
b4e1ffebd4
15 files changed
+1683
-560
No files matched your search
+28
-4
@@ -985,11 +985,11 @@ hold the saved pose.
|
||||
|
||||
| Where | Fields |
|
||||
|---|---|
|
||||
| joint node `extras.blend` (Bone) | `bone = true`, `length`, `deform`, `use_connect`, `show_wire`, `hide`, `head_local` / `tail_local` (armature space), `roll` (radians, armature space), `collections` (names, in collection order), `color` |
|
||||
| joint node `extras.blend` (pose bone) | `rotation_mode` (`"QUATERNION"`, `"XYZ"` .. `"ZYX"`, `"AXIS_ANGLE"`), `lock_location` / `lock_rotation` / `lock_scale` (3 booleans), `lock_rotation_w`, `lock_rotations_4d`, `custom_shape` (node index, or the object's name when it is not in the scene), `custom_shape_transform` (bone name), `custom_shape_translation` / `custom_shape_rotation_euler` / `custom_shape_scale_xyz`, `use_custom_shape_bone_size`, `custom_shape_wire_width` (4.2+), `ik_stretch`, `lock_ik_x/y/z`, `use_ik_limit_x/y/z`, `ik_min_x/y/z`, `ik_max_x/y/z`, `ik_stiffness_x/y/z`, `pose_color`, `constraints` |
|
||||
| joint node `extras.blend` (Bone) | `bone = true`, `length`, `deform`, `use_connect`, `show_wire`, `hide`, `head_local` / `tail_local` (armature space), `roll` (radians, armature space), `collections` (names, in collection order), `color`, `inherit_scale` (`"FULL"`, `"FIX_SHEAR"`, `"ALIGNED"`, `"AVERAGE"`, `"NONE"`, `"NONE_LEGACY"`), `use_inherit_rotation`, `use_local_location`, `use_relative_parent`; b-bones: `bbone_segments`, `bbone_x`, `bbone_z`, `bbone_easein` / `bbone_easeout`, `bbone_rollin` / `bbone_rollout`, `bbone_curveinx` / `bbone_curveinz` / `bbone_curveoutx` / `bbone_curveoutz`, `bbone_scalein` / `bbone_scaleout` (3 numbers), `bbone_handle_type_start` / `_end` (`"AUTO"`, `"ABSOLUTE"`, `"RELATIVE"`, `"TANGENT"`), `bbone_custom_handle_start` / `_end` (bone names), `use_endroll_as_inroll`, `bbone_mapping_mode` |
|
||||
| joint node `extras.blend` (pose bone) | `rotation_mode` (`"QUATERNION"`, `"XYZ"` .. `"ZYX"`, `"AXIS_ANGLE"`), `lock_location` / `lock_rotation` / `lock_scale` (3 booleans), `lock_rotation_w`, `lock_rotations_4d`, `custom_shape` (node index, or the object's name when it is not in the scene), `custom_shape_transform` (bone name), `custom_shape_translation` / `custom_shape_rotation_euler` / `custom_shape_scale_xyz`, `use_custom_shape_bone_size`, `custom_shape_wire_width` (4.2+), `ik_stretch`, `lock_ik_x/y/z`, `use_ik_limit_x/y/z`, `ik_min_x/y/z`, `ik_max_x/y/z`, `ik_stiffness_x/y/z`, `pose_color`, `constraints`; the stored basis `location`, `rotation_quaternion` (w, x, y, z), `rotation_euler`, `rotation_axis_angle` (angle, x, y, z), `scale` |
|
||||
| armature node `extras.blend` | `bone_collections`: `{ name, visible, parent? }` (parent by name; files before 4.0 get Blender 4.0's conversion: a `Layer N` collection per used layer, then one hidden collection per bone group) |
|
||||
| any object node `extras.blend` | `constraints` (object constraints), `hide_viewport`, `hide_render` (when set) |
|
||||
| `scene.meta.blend` | `widgets`: every custom shape object `{ name, type, node?, mesh? }` (objects outside the scene's collections get a mesh without a node; edge-only meshes as `"lines"` primitives); `bone_color_sets`: the default theme's `THEME01` .. `THEME20` |
|
||||
| `scene.meta.blend` | `widgets`: every custom shape object `{ name, type, node?, mesh? }` (objects outside the scene's collections get a mesh without a node; edge-only meshes as `"lines"` primitives); `bone_color_sets`: the default theme's `THEME01` .. `THEME20`; `actions`: every action in the file (below) |
|
||||
|
||||
A colour is `{ palette, normal, select, active }`: `palette` is `"THEME01"` .. `"THEME20"` or `"CUSTOM"` (nil: the
|
||||
default colour), the three colours are 0..1 sRGB (the custom colours, or the theme set's). Before 4.0 the bone group
|
||||
@@ -1005,17 +1005,37 @@ Type fields:
|
||||
| `IK` | `pole_target`, `pole_subtarget`, `pole_angle`, `chain_count`, `iterations`, `use_tail`, `use_stretch`, `use_location`, `use_rotation`, `weight`, `orient_weight`, `lock_location_x/y/z`, `lock_rotation_x/y/z`, `ik_type`, `distance` |
|
||||
| `COPY_ROTATION` | `use_x/y/z`, `invert_x/y/z`, `euler_order`, `mix_mode` |
|
||||
| `COPY_LOCATION` | `use_x/y/z`, `invert_x/y/z`, `use_offset` |
|
||||
| `COPY_SCALE` | `use_x/y/z`, `use_offset`, `power` |
|
||||
| `COPY_SCALE` | `use_x/y/z`, `use_offset`, `use_add`, `use_make_uniform`, `power` |
|
||||
| `COPY_TRANSFORMS` | `mix_mode`, `remove_target_shear` |
|
||||
| `DAMPED_TRACK` | `track_axis` |
|
||||
| `LIMIT_ROTATION` | `use_limit_x/y/z`, `min_x/y/z`, `max_x/y/z`, `euler_order`, `use_transform_limit` |
|
||||
| `LIMIT_LOCATION`, `LIMIT_SCALE` | `use_min_x/y/z`, `use_max_x/y/z`, `min_x/y/z`, `max_x/y/z`, `use_transform_limit` |
|
||||
| `CHILD_OF` | `use_location_x/y/z`, `use_rotation_x/y/z`, `use_scale_x/y/z`, `set_inverse_pending`, `inverse_matrix` (column-major) |
|
||||
| `ACTION` | `action` (name, see `meta.blend.actions`), `transform_channel` (`"LOCATION_X"` .. `"SCALE_Z"`), `frame_start`, `frame_end`, `min`, `max`, `mix_mode` (`"BEFORE_FULL"`, `"BEFORE"`, `"BEFORE_SPLIT"`, `"AFTER_FULL"`, `"AFTER"`, `"AFTER_SPLIT"`), `use_bone_object_action`, `use_eval_time`, `eval_time` |
|
||||
| `TRANSFORM` | `map_from`, `map_to` (`"LOCATION"`, `"ROTATION"`, `"SCALE"`), `map_to_x_from` / `_y_` / `_z_` (`"X"`, `"Y"`, `"Z"`), `from_min_x` .. `to_max_z` with `_rot` and `_scale` variants (`from_max_x_rot`, `to_min_y_scale`, ...), `mix_mode`, `mix_mode_rot`, `mix_mode_scale`, `use_motion_extrapolate`, `from_rotation_mode` (`"AUTO"`, euler orders, `"QUATERNION"`, `"SWING_TWIST_X/Y/Z"`), `to_euler_order` |
|
||||
| `STRETCH_TO` | `rest_length`, `bulge`, `volume` (`"VOLUME_XZX"`, `"VOLUME_X"`, `"VOLUME_Z"`, `"NO_VOLUME"`), `keep_axis` (`"PLANE_X"`, `"PLANE_Z"`, `"SWING_Y"`), `use_bulge_min`, `use_bulge_max`, `bulge_min`, `bulge_max`, `bulge_smooth` |
|
||||
| `ARMATURE` | `targets`, `use_deform_preserve_volume`, `use_bone_envelopes`, `use_current_location` |
|
||||
| `FLOOR` | `floor_location`, `offset`, `use_rotation` |
|
||||
| `LIMIT_DISTANCE` | `distance`, `limit_mode` |
|
||||
| `TRACK_TO` | `track_axis`, `up_axis`, `use_target_z` |
|
||||
| `LOCKED_TRACK` | `track_axis`, `lock_axis` |
|
||||
|
||||
Shape keys: `mesh.extras.blend.shape_keys` lists every key in file order (the basis too) as `{ name, value, slider_min,
|
||||
slider_max, mute, relative_key, vertex_group? }`, and `reference_key` names the basis. Actions on shape key values
|
||||
become `weights` channels (clamped to the slider range).
|
||||
|
||||
Joint nodes model the plain parent chain: Blender's inheritance settings (`use_inherit_rotation`, `inherit_scale`,
|
||||
`use_local_location`) and b-bone deformation are data for an evaluator, not applied to the joints or skins.
|
||||
|
||||
Actions: `scene.meta.blend.actions[name] = { frame_range = { start, end }, curves }` holds every action in the file
|
||||
(`rawActions = false` skips them), assigned or not, so action constraints can evaluate them at any frame; the
|
||||
sampled `scene.animations` are unchanged. A curve is `{ data_path, bone?, path, array_index, extrapolation, keys }`
|
||||
(`bone` and `path` split `pose.bones["name"].location`; other paths keep `path = data_path`; `extrapolation` is
|
||||
`"CONSTANT"` or `"LINEAR"`), a key `{ co = { frame, value }, interpolation, easing, handle_left, handle_right,
|
||||
handle_left_type, handle_right_type, back, amplitude, period }` with Blender's interpolation and easing names. Layered
|
||||
actions (4.4+) give the first layer's first strip's first channel bag; files before 2.5 have IPOs instead (their
|
||||
object and shape key IPOs are still sampled into `scene.animations`).
|
||||
|
||||
```luau
|
||||
local rig = assert(F.model.load(riggedBlendBytes))
|
||||
local joint = {}
|
||||
@@ -1037,6 +1057,10 @@ assert(widget.name == "WGT_ring" and widget.node == nil)
|
||||
assert(rig.meshes[widget.mesh].primitives[1].mode == "lines")
|
||||
local tube = rig.meshes[1]
|
||||
assert(tube.extras.targetNames[1] == "Bulge" and tube.extras.blend.shape_keys[2].slider_max == 2)
|
||||
for name, action in rig.meta.blend.actions do
|
||||
local curve = action.curves[1]
|
||||
print(name, action.frame_range[1], action.frame_range[2], curve.bone, curve.path, curve.keys[1].interpolation)
|
||||
end
|
||||
```
|
||||
|
||||
Anything else in the file is reachable through the container: `F.format("blend").open` parses the blocks and the
|
||||
|
||||
Reference in new issue
Block a user