forked from LeenkxTeam/LNXSDK
added last needed important rigid body settings in the blender RB leenkx settings for game engine ? like min max velocity,damping and lock translation and rotationboolean settings
This commit is contained in:
@ -2830,8 +2830,8 @@ class LeenkxExporter:
|
||||
deact_av = 0.0
|
||||
deact_time = 0.0
|
||||
body_params = {}
|
||||
body_params['linearDamping'] = rb.linear_damping
|
||||
body_params['angularDamping'] = rb.angular_damping
|
||||
body_params['linearDamping'] = bobject.lnx_rb_linear_damping
|
||||
body_params['angularDamping'] = bobject.lnx_rb_angular_damping
|
||||
body_params['linearFactorsX'] = lx
|
||||
body_params['linearFactorsY'] = ly
|
||||
body_params['linearFactorsZ'] = lz
|
||||
@ -2843,6 +2843,18 @@ class LeenkxExporter:
|
||||
body_params['linearDeactivationThreshold'] = deact_lv
|
||||
body_params['angularDeactivationThrshold'] = deact_av
|
||||
body_params['deactivationTime'] = deact_time
|
||||
# New velocity limit properties
|
||||
body_params['linearVelocityMin'] = bobject.lnx_rb_linear_velocity_min
|
||||
body_params['linearVelocityMax'] = bobject.lnx_rb_linear_velocity_max
|
||||
body_params['angularVelocityMin'] = bobject.lnx_rb_angular_velocity_min
|
||||
body_params['angularVelocityMax'] = bobject.lnx_rb_angular_velocity_max
|
||||
# New lock properties
|
||||
body_params['lockTranslationX'] = bobject.lnx_rb_lock_translation_x
|
||||
body_params['lockTranslationY'] = bobject.lnx_rb_lock_translation_y
|
||||
body_params['lockTranslationZ'] = bobject.lnx_rb_lock_translation_z
|
||||
body_params['lockRotationX'] = bobject.lnx_rb_lock_rotation_x
|
||||
body_params['lockRotationY'] = bobject.lnx_rb_lock_rotation_y
|
||||
body_params['lockRotationZ'] = bobject.lnx_rb_lock_rotation_z
|
||||
body_flags = {}
|
||||
body_flags['animated'] = rb.kinematic
|
||||
body_flags['trigger'] = bobject.lnx_rb_trigger
|
||||
|
@ -368,6 +368,29 @@ def init_properties():
|
||||
default=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False),
|
||||
size=20,
|
||||
subtype='LAYER')
|
||||
|
||||
# Linear velocity limits
|
||||
bpy.types.Object.lnx_rb_linear_velocity_min = FloatProperty(name="Linear Velocity Min", description="Minimum linear velocity", default=0.0, min=0.0)
|
||||
bpy.types.Object.lnx_rb_linear_velocity_max = FloatProperty(name="Linear Velocity Max", description="Maximum linear velocity", default=0.0, min=0.0)
|
||||
|
||||
# Angular velocity limits
|
||||
bpy.types.Object.lnx_rb_angular_velocity_min = FloatProperty(name="Angular Velocity Min", description="Minimum angular velocity", default=0.0, min=0.0)
|
||||
bpy.types.Object.lnx_rb_angular_velocity_max = FloatProperty(name="Angular Velocity Max", description="Maximum angular velocity", default=0.0, min=0.0)
|
||||
|
||||
# Damping controls
|
||||
bpy.types.Object.lnx_rb_linear_damping = FloatProperty(name="Linear Damping", description="Linear damping factor", default=0.04, min=0.0, max=1.0)
|
||||
bpy.types.Object.lnx_rb_angular_damping = FloatProperty(name="Angular Damping", description="Angular damping factor", default=0.1, min=0.0, max=1.0)
|
||||
|
||||
# Lock translation axes
|
||||
bpy.types.Object.lnx_rb_lock_translation_x = BoolProperty(name="Lock Translation X", description="Lock movement along X axis", default=False)
|
||||
bpy.types.Object.lnx_rb_lock_translation_y = BoolProperty(name="Lock Translation Y", description="Lock movement along Y axis", default=False)
|
||||
bpy.types.Object.lnx_rb_lock_translation_z = BoolProperty(name="Lock Translation Z", description="Lock movement along Z axis", default=False)
|
||||
|
||||
# Lock rotation axes
|
||||
bpy.types.Object.lnx_rb_lock_rotation_x = BoolProperty(name="Lock Rotation X", description="Lock rotation around X axis", default=False)
|
||||
bpy.types.Object.lnx_rb_lock_rotation_y = BoolProperty(name="Lock Rotation Y", description="Lock rotation around Y axis", default=False)
|
||||
bpy.types.Object.lnx_rb_lock_rotation_z = BoolProperty(name="Lock Rotation Z", description="Lock rotation around Z axis", default=False)
|
||||
|
||||
bpy.types.Object.lnx_relative_physics_constraint = BoolProperty(name="Relative Physics Constraint", description="Add physics constraint relative to the parent object or collection when spawned", default=False)
|
||||
bpy.types.Object.lnx_animation_enabled = BoolProperty(name="Animation", description="Enable skinning & timeline animation", default=True)
|
||||
bpy.types.Object.lnx_tilesheet = StringProperty(name="Tilesheet", description="Set tilesheet animation", default='')
|
||||
|
@ -240,6 +240,41 @@ class LNX_PT_PhysicsPropsPanel(bpy.types.Panel):
|
||||
layout.prop(obj, 'lnx_rb_linear_factor')
|
||||
layout.prop(obj, 'lnx_rb_angular_factor')
|
||||
layout.prop(obj, 'lnx_rb_angular_friction')
|
||||
|
||||
# Linear Velocity section
|
||||
layout.separator()
|
||||
layout.label(text="Linear Velocity:")
|
||||
layout.prop(obj, 'lnx_rb_linear_velocity_min')
|
||||
layout.prop(obj, 'lnx_rb_linear_velocity_max')
|
||||
|
||||
# Angular Velocity section
|
||||
layout.separator()
|
||||
layout.label(text="Angular Velocity:")
|
||||
layout.prop(obj, 'lnx_rb_angular_velocity_min')
|
||||
layout.prop(obj, 'lnx_rb_angular_velocity_max')
|
||||
|
||||
# Damping section
|
||||
layout.separator()
|
||||
layout.label(text="Damping:")
|
||||
layout.prop(obj, 'lnx_rb_linear_damping')
|
||||
layout.prop(obj, 'lnx_rb_angular_damping')
|
||||
|
||||
# Lock Translation section
|
||||
layout.separator()
|
||||
layout.label(text="Lock Translation:")
|
||||
row = layout.row(align=True)
|
||||
row.prop(obj, 'lnx_rb_lock_translation_x', text="X")
|
||||
row.prop(obj, 'lnx_rb_lock_translation_y', text="Y")
|
||||
row.prop(obj, 'lnx_rb_lock_translation_z', text="Z")
|
||||
|
||||
# Lock Rotation section
|
||||
layout.separator()
|
||||
layout.label(text="Lock Rotation:")
|
||||
row = layout.row(align=True)
|
||||
row.prop(obj, 'lnx_rb_lock_rotation_x', text="X")
|
||||
row.prop(obj, 'lnx_rb_lock_rotation_y', text="Y")
|
||||
row.prop(obj, 'lnx_rb_lock_rotation_z', text="Z")
|
||||
|
||||
layout.prop(obj, 'lnx_rb_trigger')
|
||||
layout.prop(obj, 'lnx_rb_ccd')
|
||||
layout.prop(obj, 'lnx_rb_interpolate')
|
||||
|
Reference in New Issue
Block a user