If I want to create multiple animations for different wind speeds, which of the scripted steps need to be repeated for each animation?
I wrote this for myself:
---------- start and animation 1 ---------------
- Create the plane of the flag, rotate so that it using XZ plane
- make sure the left edge / the attach position of the flag is at "0 / 0" so that a rotation around "Z" axis will rotate correctly according to wind
- Place it where it is needed APPLY ALL TRANSFORMS (rotation, scale, location) now!!!
- Subdivide as much as needed
- Add Vertex Group at left edge -> name it "Pinned"
- Apply Cloth modifier
- Add Wind
- Tweak Cloth until wished result
- Select Flag-plane and go into Object mode
- Start Script "00_Flag_Python_AssignVertexGroups.py"
- Create bones for each vertex point, starting top left, ending bottom right
- Go into Pose Mode of Armature
- Open AND EDIT Script "01_Flag_Python_AssignConstraintsToBones.py" -> Include name of target plane object
- Start script
- Set Timeline to "0", Start 0, End 0 -> Default_State
- Apply Baking simulation to bones,
- in "Dope-Sheet" "Action Editor" select keyframe, and copy it
- insert copied keyframe at position "1" and "2"
- "push down" and create NLA track
- duplicate Plane, name it "_anim" (so you now have 2 planes), remove Cloth simulation from "_anim" plane
- Move former plane to a new "collection" (to be able to fully disable it while working) -> we will do the cloth simulation with it
- Parent new plane with "empty groups" Armature and Flag Plane
- Select Flag plane in object mode
- Start Script "02_Flag_Python_AssignBoneGroupsToVerticesWeightPaint.py"
- Open "NLA Track" Editor, rename both parts to "Default_State"
----------- animation 2 and following ----------
- only show "cloth" plane, disable "_anim" plane
- tweak cloth simulation as needed
- Find perfect part of animation loop
- Go into Pose Mode of Armature, select all bones
- Start script "01_Flag_Python_AssignConstraintsToBones.py"
- Set start and End of timeline to "perfect" loop
- Apply Baking simulation to bones -> dope sheet - action editor -> rename track -> "push down" and create NLA track
- rename NLA Track, reorder NLA track if needed
- disable "work" collection
- Parent new plane "_anim" with "empty groups" Armature and Flag Plane
- Select Flag plane in object mode
- Start Script "02_Flag_Python_AssignBoneGroupsToVerticesWeightPaint.py"
- Add axis and parent all
- Export