Merge branch 'master' of https://github.com/armory3d/armory
This commit is contained in:
commit
675211c66a
|
@ -62,7 +62,7 @@ class PhysicsBreak extends Trait {
|
|||
var ud = breaker.userDataMap.get(cast o);
|
||||
var params = [0.04, 0.1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.04, 0.0, 0.0, 0.0];
|
||||
o.addTrait(new RigidBody(Shape.ConvexHull, ud.mass, ud.friction, 0, 1, params));
|
||||
if (cast(o, MeshObject).data.geom.positions.length < 600) {
|
||||
if (cast(o, MeshObject).data.geom.positions.values.length < 600) {
|
||||
o.addTrait(new PhysicsBreak());
|
||||
}
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ class ConvexBreaker {
|
|||
}
|
||||
|
||||
public function initBreakableObject(object: MeshObject, mass: Float, friction: Float, velocity: Vec4, angularVelocity: Vec4, breakable: Bool) {
|
||||
var ar = object.data.geom.positions;
|
||||
var ar = object.data.geom.positions.values;
|
||||
var scalePos = object.data.scalePos;
|
||||
// Create vertices mark
|
||||
var sc = object.transform.scale;
|
||||
|
@ -550,11 +550,11 @@ class ConvexBreaker {
|
|||
var inda = new kha.arrays.Uint32Array(ind.length);
|
||||
for (i in 0...ind.length) inda.set(i, ind[i]);
|
||||
|
||||
var pos: TVertexArray = { attrib: "pos", values: paa };
|
||||
var nor: TVertexArray = { attrib: "nor", values: naa };
|
||||
var pos: TVertexArray = { attrib: "pos", values: paa, data: "short4norm" };
|
||||
var nor: TVertexArray = { attrib: "nor", values: naa, data: "short2norm" };
|
||||
var indices: TIndexArray = { material: 0, values: inda };
|
||||
|
||||
var rawmesh: TMeshData = {
|
||||
var rawmesh: TMeshData = {
|
||||
name: "TempMesh" + (meshIndex++),
|
||||
vertex_arrays: [pos, nor],
|
||||
index_arrays: [indices],
|
||||
|
|
|
@ -331,7 +331,7 @@ class KinematicCharacterController extends Trait {
|
|||
}
|
||||
|
||||
function addPointsToConvexHull(shape: bullet.Bt.ConvexHullShape, scale: Vec4, margin: Float) {
|
||||
var positions = cast(object, MeshObject).data.geom.positions;
|
||||
var positions = cast(object, MeshObject).data.geom.positions.values;
|
||||
|
||||
var sx = scale.x * (1.0 - margin);
|
||||
var sy = scale.y * (1.0 - margin);
|
||||
|
|
|
@ -97,7 +97,7 @@ class PhysicsHook extends Trait {
|
|||
#end
|
||||
|
||||
var geom = cast(object, MeshObject).data.geom;
|
||||
var numNodes = Std.int(geom.positions.length / 4);
|
||||
var numNodes = Std.int(geom.positions.values.length / 4);
|
||||
for (i in 0...numNodes) {
|
||||
var node = nodes.at(i);
|
||||
#if js
|
||||
|
|
|
@ -486,7 +486,7 @@ class RigidBody extends iron.Trait {
|
|||
convexHullCache.set(data, shape);
|
||||
usersCache.set(data, 1);
|
||||
|
||||
var positions = data.geom.positions;
|
||||
var positions = data.geom.positions.values;
|
||||
|
||||
var sx: kha.FastFloat = scale.x * (1.0 - margin) * (1 / 32767);
|
||||
var sy: kha.FastFloat = scale.y * (1.0 - margin) * (1 / 32767);
|
||||
|
@ -520,7 +520,7 @@ class RigidBody extends iron.Trait {
|
|||
triangleMeshCache.set(data, triangleMesh);
|
||||
usersCache.set(data, 1);
|
||||
|
||||
var positions = data.geom.positions;
|
||||
var positions = data.geom.positions.values;
|
||||
var indices = data.geom.indices;
|
||||
|
||||
var sx: kha.FastFloat = scale.x * (1 / 32767);
|
||||
|
|
|
@ -92,7 +92,7 @@ class SoftBody extends Trait {
|
|||
object.transform.buildMatrix();
|
||||
}
|
||||
|
||||
var positions = fromI16(geom.positions, mo.data.scalePos);
|
||||
var positions = fromI16(geom.positions.values, mo.data.scalePos);
|
||||
for (i in 0...Std.int(positions.length / 3)) {
|
||||
v.set(positions[i * 3], positions[i * 3 + 1], positions[i * 3 + 2]);
|
||||
v.applyQuat(object.transform.rot);
|
||||
|
|
|
@ -837,7 +837,7 @@ class ArmoryExporter:
|
|||
action_obj['name'] = aname
|
||||
action_obj['objects'] = bones
|
||||
arm.utils.write_arm(fp, action_obj)
|
||||
|
||||
|
||||
#clear baked actions
|
||||
for a in baked_actions:
|
||||
bpy.data.actions.remove( a, do_unlink=True)
|
||||
|
@ -1152,16 +1152,16 @@ class ArmoryExporter:
|
|||
|
||||
# Output
|
||||
o['vertex_arrays'] = []
|
||||
o['vertex_arrays'].append({ 'attrib': 'pos', 'values': pdata })
|
||||
o['vertex_arrays'].append({ 'attrib': 'nor', 'values': ndata })
|
||||
o['vertex_arrays'].append({ 'attrib': 'pos', 'values': pdata, 'data': 'short4norm' })
|
||||
o['vertex_arrays'].append({ 'attrib': 'nor', 'values': ndata, 'data': 'short2norm' })
|
||||
if has_tex:
|
||||
o['vertex_arrays'].append({ 'attrib': 'tex', 'values': t0data })
|
||||
o['vertex_arrays'].append({ 'attrib': 'tex', 'values': t0data, 'data': 'short2norm' })
|
||||
if has_tex1:
|
||||
o['vertex_arrays'].append({ 'attrib': 'tex1', 'values': t1data })
|
||||
o['vertex_arrays'].append({ 'attrib': 'tex1', 'values': t1data, 'data': 'short2norm' })
|
||||
if has_col:
|
||||
o['vertex_arrays'].append({ 'attrib': 'col', 'values': cdata })
|
||||
o['vertex_arrays'].append({ 'attrib': 'col', 'values': cdata, 'data': 'short4norm', 'padding': 1 })
|
||||
if has_tang:
|
||||
o['vertex_arrays'].append({ 'attrib': 'tang', 'values': tangdata })
|
||||
o['vertex_arrays'].append({ 'attrib': 'tang', 'values': tangdata, 'data': 'short4norm', 'padding': 1 })
|
||||
|
||||
# If there are multiple morph targets, export them here.
|
||||
# if (shapeKeys):
|
||||
|
@ -1433,13 +1433,27 @@ class ArmoryExporter:
|
|||
if has_proxy_user:
|
||||
continue
|
||||
|
||||
asset_name = arm.utils.asset_name(bobject)
|
||||
|
||||
# Add external linked objects
|
||||
if bobject.name not in scene_objects and collection.library is not None:
|
||||
if collection.library is not None:
|
||||
# Iron differentiates objects based on their names,
|
||||
# so errors will happen if two objects with the
|
||||
# same name exists. This check is only required
|
||||
# when the object in question is in a library,
|
||||
# otherwise Blender will not allow duplicate names
|
||||
if asset_name in scene_objects:
|
||||
log.warn("skipping export of the object"
|
||||
f" {bobject.name} (collection"
|
||||
f" {collection.name}) because it has the same"
|
||||
" export name as another object in the scene:"
|
||||
f" {asset_name}")
|
||||
continue
|
||||
|
||||
self.process_bobject(bobject)
|
||||
self.export_object(bobject, self.scene)
|
||||
out_collection['object_refs'].append(arm.utils.asset_name(bobject))
|
||||
else:
|
||||
out_collection['object_refs'].append(bobject.name)
|
||||
|
||||
out_collection['object_refs'].append(asset_name)
|
||||
|
||||
self.output['groups'].append(out_collection)
|
||||
|
||||
|
|
|
@ -719,11 +719,11 @@ def open_editor(hx_path=None):
|
|||
|
||||
def open_folder():
|
||||
if arm.utils.get_os() == 'win':
|
||||
subprocess.Popen(['explorer', arm.utils.get_fp()])
|
||||
subprocess.run(['explorer', arm.utils.get_fp()])
|
||||
elif arm.utils.get_os() == 'mac':
|
||||
subprocess.Popen(['open', arm.utils.get_fp()])
|
||||
subprocess.run(['open', arm.utils.get_fp()])
|
||||
elif arm.utils.get_os() == 'linux':
|
||||
subprocess.Popen(['xdg-open', arm.utils.get_fp()])
|
||||
subprocess.run(['xdg-open', arm.utils.get_fp()])
|
||||
else:
|
||||
webbrowser.open('file://' + arm.utils.get_fp())
|
||||
|
||||
|
|
Loading…
Reference in a new issue