2022-03-29 18:46:33 +02:00
|
|
|
import bpy
|
|
|
|
from bpy.props import (
|
|
|
|
IntProperty,
|
|
|
|
BoolProperty,
|
|
|
|
StringProperty,
|
|
|
|
FloatProperty,
|
|
|
|
EnumProperty,
|
|
|
|
)
|
|
|
|
|
2022-04-20 12:02:19 +02:00
|
|
|
class AW_PG_settings(bpy.types.PropertyGroup) :
|
2022-03-29 18:46:33 +02:00
|
|
|
## HIDDEN to hide the animatable dot thing
|
2022-04-11 19:46:22 +02:00
|
|
|
|
|
|
|
tweak : bpy.props.BoolProperty(
|
|
|
|
name="Tweak", description="Show Tweaking options",
|
|
|
|
default=False, options={'HIDDEN'})
|
|
|
|
|
2022-04-13 18:38:03 +02:00
|
|
|
tgt_bone : bpy.props.StringProperty(
|
|
|
|
name="Bone to constrain", default='',
|
|
|
|
description="Name of the bone to constrain with follow path (usually the root bone)")
|
|
|
|
|
2022-03-29 18:46:33 +02:00
|
|
|
path_to_follow : bpy.props.PointerProperty(type=bpy.types.Object,
|
|
|
|
name="Path", description="Curve object used")
|
|
|
|
|
|
|
|
gnd : bpy.props.PointerProperty(type=bpy.types.Object,
|
|
|
|
name="Ground", description="Choose the ground object to use")
|
|
|
|
|
|
|
|
expand_on_selected_bones : bpy.props.BoolProperty(
|
|
|
|
name="On selected", description="Expand on selected bones",
|
2022-03-30 17:40:52 +02:00
|
|
|
default=False, options={'HIDDEN'})
|
2022-03-29 18:46:33 +02:00
|
|
|
|
|
|
|
linear : bpy.props.BoolProperty(
|
2022-03-30 17:40:52 +02:00
|
|
|
name="Linear", description="keep the animation path linear\
|
|
|
|
\nElse step the path usings follow path cycle keys)",
|
|
|
|
default=True, options={'HIDDEN'})
|
2022-03-29 18:46:33 +02:00
|
|
|
|
|
|
|
start_frame : bpy.props.IntProperty(
|
|
|
|
name="Start Frame", description="Starting frame for animation path",
|
2022-04-27 12:01:39 +02:00
|
|
|
default=100,
|
2022-03-29 18:46:33 +02:00
|
|
|
min=0, max=2**31-1, soft_min=0, soft_max=2**31-1, step=1, options={'HIDDEN'})#, subtype='PIXEL'
|
|
|
|
|
2022-04-20 17:54:49 +02:00
|
|
|
end_frame : bpy.props.IntProperty(
|
|
|
|
name="End Frame", description="End frame, to calculate when character should reach the end of the path",
|
|
|
|
default=101,
|
|
|
|
min=0, max=2**31-1, soft_min=0, soft_max=2**31-1, step=1, options={'HIDDEN'})#, subtype='PIXEL'
|
|
|
|
|
2022-03-29 18:46:33 +02:00
|
|
|
forward_axis : bpy.props.EnumProperty(
|
|
|
|
name='Forward Axis',
|
2022-04-11 11:41:56 +02:00
|
|
|
default='FORWARD_Z', # Modifier default is FORWARD_X (should be TRACK_NEGATIVE_Y for a good rig)
|
2022-04-11 19:46:22 +02:00
|
|
|
description='Local axis of the "root" bone that point forward in rest pose',
|
2022-03-29 18:46:33 +02:00
|
|
|
items=(
|
|
|
|
('FORWARD_X', 'X', ''),
|
|
|
|
('FORWARD_Y', 'Y', ''),
|
|
|
|
('FORWARD_Z', 'Z', ''),
|
|
|
|
('TRACK_NEGATIVE_X', '-X', ''),
|
|
|
|
('TRACK_NEGATIVE_Y', '-Y', ''),
|
|
|
|
('TRACK_NEGATIVE_Z', '-Z', ''),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2022-10-15 19:13:50 +02:00
|
|
|
custom_pin : bpy.props.BoolProperty(
|
|
|
|
name="Custom Pinning", description="Pin only specific axis\
|
|
|
|
\nElse pin all location and rotation",
|
|
|
|
default=False, options={'HIDDEN'})
|
|
|
|
|
|
|
|
pin_loc_x : bpy.props.BoolProperty(
|
|
|
|
name="Pin Loc X", description="Pin bones location X", default=True, options={'HIDDEN'})
|
|
|
|
pin_loc_y : bpy.props.BoolProperty(
|
|
|
|
name="Pin Loc Y", description="Pin bones location Y", default=True, options={'HIDDEN'})
|
|
|
|
pin_loc_z : bpy.props.BoolProperty(
|
|
|
|
name="Pin Loc Z", description="Pin bones location Z", default=True, options={'HIDDEN'})
|
|
|
|
|
|
|
|
pin_rot_x : bpy.props.BoolProperty(
|
|
|
|
name="Pin Rot X", description="Pin bones rotation X", default=True, options={'HIDDEN'})
|
|
|
|
pin_rot_y : bpy.props.BoolProperty(
|
|
|
|
name="Pin Rot Y", description="Pin bones rotation Y", default=True, options={'HIDDEN'})
|
|
|
|
pin_rot_z : bpy.props.BoolProperty(
|
|
|
|
name="Pin Rot Z", description="Pin bones rotation Z", default=True, options={'HIDDEN'})
|
|
|
|
|
2023-03-09 11:18:44 +01:00
|
|
|
## Wrap properties
|
2023-03-08 17:59:49 +01:00
|
|
|
wrap_ref_bone : bpy.props.StringProperty(
|
|
|
|
name="Reference Bone",
|
|
|
|
description="Reference bone to calculate offset towards Root bone"
|
|
|
|
)
|
|
|
|
|
|
|
|
wrap_root_bone : bpy.props.StringProperty(
|
|
|
|
name="Root Bone",
|
2023-03-09 11:18:44 +01:00
|
|
|
# default="root", # should be root or walk
|
2023-03-08 17:59:49 +01:00
|
|
|
description="Root bone, on each keyframe\
|
2023-03-09 11:18:44 +01:00
|
|
|
\nthe offset between ref bon and root bone will be applied to selected pose bones"
|
2023-03-08 17:59:49 +01:00
|
|
|
)
|
|
|
|
|
2022-03-29 18:46:33 +02:00
|
|
|
"""
|
|
|
|
## foot axis not needed (not always aligned with character direction)
|
|
|
|
foot_axis : EnumProperty(
|
|
|
|
name="Foot Axis", description="Foot forward axis",
|
|
|
|
default='Y', options={'HIDDEN', 'SKIP_SAVE'},
|
|
|
|
items=(
|
|
|
|
('X', 'X', '', 0),
|
|
|
|
('Y', 'Y', '', '', 1),
|
|
|
|
('Z', 'Z', '', '', 2),
|
|
|
|
# ('-X', '-X', '', 3),
|
|
|
|
# ('-Y', '-Y', '', '', 4),
|
|
|
|
# ('-Z', '-Z', '', '', 5),
|
|
|
|
))
|
|
|
|
"""
|
|
|
|
|
|
|
|
def register():
|
2022-04-20 12:02:19 +02:00
|
|
|
bpy.utils.register_class(AW_PG_settings)
|
|
|
|
bpy.types.Scene.anim_cycle_settings = bpy.props.PointerProperty(type = AW_PG_settings)
|
2022-03-29 18:46:33 +02:00
|
|
|
|
|
|
|
def unregister():
|
2022-04-20 12:02:19 +02:00
|
|
|
bpy.utils.unregister_class(AW_PG_settings)
|
2022-03-29 18:46:33 +02:00
|
|
|
del bpy.types.Scene.anim_cycle_settings
|