model/blend: vertex and triangle parents, parent_type / parent_bone / parent_vertices / matrix_parent_inverse, widget flags, modifier stacks with Blender's type names and the armature modifier's settings

This commit is contained in:
4DBug committed 2026-11-03 04:57:53 -06:00
1 parent a9874e9f54
commit 2c2a52e4b3
11 files changed
+1003 -405

No files matched your search

+33 -1
View File
@@ -15,7 +15,8 @@
# action constraint; transform / armature / floor / limit distance / track to / locked
# track constraints; bone inheritance and b-bone settings; a saved pose basis; drivers
# (every variable type, keys, modifiers) on the rig, its data and the shape keys; custom
# properties on pose bones, bones and objects
# properties on pose bones, bones and objects; vertex, vertex-triangle and lattice parents,
# an object parented to a bone
# mat_<ver>.blend material graphs: images through Mix / MixRGB, Hue-Saturation, Bright-Contrast, Gamma,
# Invert, RGB Curves, Color Ramp, reroutes and node groups; roughness images linked directly
# or through a ramp; vertex colours; bump; unresolved links; a UDIM image with two tiles
@@ -732,6 +733,37 @@ def ctl_file():
smile.value = v
smile.keyframe_insert("value", frame=f)
smile.value = 1.5
# vertex / triangle / lattice / bone parents
from mathutils import Matrix
anchor = link(bpy.data.objects.new("Anchor", mesh("AnchorMesh", [(0, 0, 0), (1, 0.2, 0), (0.3, 1, 0.4), (0.5, 0.5, 1)], [(0, 1, 2), (0, 2, 3)])))
anchor.location, anchor.rotation_euler, anchor.scale = (2, -2, 1), (0.3, 0.2, 0.5), (1, 1.5, 1)
update()
vkid = link(bpy.data.objects.new("VertKid", None))
vkid.parent, vkid.parent_type = anchor, "VERTEX"
vkid.parent_vertices = (2, 0, 0)
vkid.location = (0.1, 0.2, 0.3)
vkid.matrix_parent_inverse = Matrix.Translation((0.5, 0, -0.25))
tkid = link(bpy.data.objects.new("TriKid", None))
tkid.parent, tkid.parent_type = anchor, "VERTEX_3"
tkid.parent_vertices = (1, 2, 3)
tkid.location, tkid.rotation_euler = (0.2, 0, 0.1), (0.1, 0.4, 0)
lat = link(bpy.data.objects.new("Lat", bpy.data.lattices.new("LatData")))
lat.location = (-2, 1, 0)
caged = link(bpy.data.objects.new("Caged", mesh("CagedMesh", [(0, 0, 0), (1, 0, 0), (0, 1, 0)], [(0, 1, 2)])))
caged.parent = lat
setp(caged, "parent_type", "LATTICE")
caged.location = (0.25, 0, 0)
caged.modifiers.new("Lattice", "LATTICE").object = lat
bkid = link(bpy.data.objects.new("BoneKid", None))
bkid.parent, bkid.parent_type, bkid.parent_bone = rig, "BONE", "lower"
bkid.location = (0.1, 0.05, 0)
face.modifiers["Armature"].use_multi_modifier = True
am = caged.modifiers.new("Unbound", "ARMATURE") # no object: deforms nothing, its settings are data
am.use_deform_preserve_volume, am.use_bone_envelopes, am.use_vertex_groups = True, True, False
am.vertex_group, am.invert_vertex_group = "spine", True
am.show_viewport = False
sub = wbox.modifiers.new("Smooth", "SUBSURF")
sub.show_render = False
# custom properties (ID properties)
props = pose["root"]
props["ik_arm"] = 1.0