Deprecated classes

This commit is contained in:
Lubos Lenco 2017-09-30 00:54:19 +02:00
parent 24aa6c4787
commit 9e65e4b242
7 changed files with 34 additions and 5 deletions

View file

@ -0,0 +1,4 @@
// TODO: Deprecated - use armory.trait.navigation
package armory.trait.internal;
typedef Navigation = armory.trait.navigation.Navigation;

View file

@ -0,0 +1,4 @@
// TODO: Deprecated - use armory.trait.physics
package armory.trait.internal;
typedef PhysicsConstraint = armory.trait.physics.PhysicsConstraint;

View file

@ -0,0 +1,4 @@
// TODO: Deprecated - use armory.trait.physics
package armory.trait.internal;
typedef PhysicsHook = armory.trait.physics.PhysicsHook;

View file

@ -0,0 +1,4 @@
// TODO: Deprecated - use armory.trait.physics
package armory.trait.internal;
typedef PhysicsWorld = armory.trait.physics.PhysicsWorld;

View file

@ -0,0 +1,4 @@
// TODO: Deprecated - use armory.trait.physics
package armory.trait.internal;
typedef RigidBody = armory.trait.physics.RigidBody;

View file

@ -0,0 +1,4 @@
// TODO: Deprecated - use armory.trait.physics
package armory.trait.internal;
typedef SoftBody = armory.trait.physics.SoftBody;

View file

@ -2693,7 +2693,8 @@ class ArmoryExporter:
self.output['traits'] = []
x = {}
x['type'] = 'Script'
x['class_name'] = 'armory.trait.physics.PhysicsWorld'
pkg = 'bullet' if bpy.data.worlds['Arm'].arm_physics == 'Bullet' else 'oimo'
x['class_name'] = 'armory.trait.physics.' + pkg + '.PhysicsWorld'
self.output['traits'].append(x)
if wrd.arm_navigation != 'Disabled' and ArmoryExporter.export_navigation:
if not 'traits' in self.output:
@ -2876,7 +2877,8 @@ class ArmoryExporter:
body_mass = rb.mass
x = {}
x['type'] = 'Script'
x['class_name'] = 'armory.trait.physics.RigidBody'
pkg = 'bullet' if bpy.data.worlds['Arm'].arm_physics == 'Bullet' else 'oimo'
x['class_name'] = 'armory.trait.physics.' + pkg + '.RigidBody'
x['parameters'] = [str(body_mass), str(shape), str(rb.friction), str(rb.restitution)]
if rb.use_margin:
x['parameters'].append(str(rb.collision_margin))
@ -2904,7 +2906,8 @@ class ArmoryExporter:
assets.add_khafile_def('arm_physics_soft')
cloth_trait = {}
cloth_trait['type'] = 'Script'
cloth_trait['class_name'] = 'armory.trait.physics.SoftBody'
pkg = 'bullet' if bpy.data.worlds['Arm'].arm_physics == 'Bullet' else 'oimo'
cloth_trait['class_name'] = 'armory.trait.physics.' + pkg + '.SoftBody'
if soft_type == 0:
bend = soft_mod.settings.bending_stiffness
elif soft_type == 1:
@ -3068,7 +3071,8 @@ class ArmoryExporter:
def add_hook_trait(self, o, bobject, target_name, group_name):
hook_trait = {}
hook_trait['type'] = 'Script'
hook_trait['class_name'] = 'armory.trait.physics.PhysicsHook'
pkg = 'bullet' if bpy.data.worlds['Arm'].arm_physics == 'Bullet' else 'oimo'
hook_trait['class_name'] = 'armory.trait.physics.' + pkg + '.PhysicsHook'
verts = []
if group_name != '':
group = bobject.vertex_groups[group_name].index
@ -3084,7 +3088,8 @@ class ArmoryExporter:
def add_constraint_trait(self, o, rb1, rb2):
constr_trait = {}
constr_trait['type'] = 'Script'
constr_trait['class_name'] = 'armory.trait.physics.PhysicsConstraint'
pkg = 'bullet' if bpy.data.worlds['Arm'].arm_physics == 'Bullet' else 'oimo'
constr_trait['class_name'] = 'armory.trait.physics.' + pkg + '.PhysicsConstraint'
constr_trait['parameters'] = ["'" + rb1.name + "'", "'" + rb2.name + "'"]
o['traits'].append(constr_trait)