mirror of https://github.com/AxioDL/metaforce.git
Blender shell protocol fixes
This commit is contained in:
parent
719c62f09f
commit
eb5cdf40b0
|
@ -395,6 +395,10 @@ public:
|
|||
std::unordered_map<std::string, int32_t> iprops;
|
||||
|
||||
Material(BlenderConnection& conn);
|
||||
bool operator==(const Material& other) const
|
||||
{
|
||||
return source == other.source && texs == other.texs && iprops == other.iprops;
|
||||
}
|
||||
};
|
||||
std::vector<std::vector<Material>> materialSets;
|
||||
|
||||
|
|
|
@ -249,7 +249,14 @@ def cookcol(writebuf, mesh_obj):
|
|||
for m in copy_mesh.materials:
|
||||
writebuf(struct.pack('I', len(m.name)))
|
||||
writebuf(m.name.encode())
|
||||
writebuf(struct.pack('Ib', m.retro_collision_type, m.retro_projectile_passthrough))
|
||||
cType = 0
|
||||
if 'retro_collision_type' in m:
|
||||
cType = m['retro_collision_type']
|
||||
projPassthrough = False
|
||||
if 'retro_projectile_passthrough' in m:
|
||||
projPassthrough = m['retro_projectile_passthrough']
|
||||
|
||||
writebuf(struct.pack('Ib', cType, projPassthrough))
|
||||
|
||||
# Send verts
|
||||
writebuf(struct.pack('I', len(copy_mesh.vertices)))
|
||||
|
|
|
@ -156,8 +156,13 @@ def dataout_loop():
|
|||
return
|
||||
|
||||
elif cmdargs[0] == 'MESHLIST':
|
||||
meshCount = 0
|
||||
for meshobj in bpy.data.objects:
|
||||
if meshobj.type == 'MESH':
|
||||
if meshobj.type == 'MESH' and not meshobj.library:
|
||||
meshCount += 1
|
||||
writepipebuf(struct.pack('I', meshCount))
|
||||
for meshobj in bpy.data.objects:
|
||||
if meshobj.type == 'MESH' and not meshobj.library:
|
||||
writepipeline(meshobj.name.encode())
|
||||
|
||||
elif cmdargs[0] == 'MESHCOMPILE':
|
||||
|
@ -214,7 +219,7 @@ def dataout_loop():
|
|||
elif cmdargs[0] == 'LIGHTCOMPILEALL':
|
||||
writepipeline(b'OK')
|
||||
lampCount = 0;
|
||||
for obj in bpy.context.scene:
|
||||
for obj in bpy.context.scene.objects:
|
||||
if obj.type == 'LAMP':
|
||||
lampCount += 1
|
||||
|
||||
|
@ -239,7 +244,7 @@ def dataout_loop():
|
|||
writepipebuf(struct.pack('fff', ambient_color[0], ambient_color[1], ambient_color[2]))
|
||||
writepipebuf(struct.pack('IIfffffb', 0, 0, ambient_energy, 0.0, 1.0, 0.0, 0.0, False))
|
||||
|
||||
for obj in bpy.context.scene:
|
||||
for obj in bpy.context.scene.objects:
|
||||
if obj.type == 'LAMP':
|
||||
wmtx = obj.matrix_world
|
||||
writepipebuf(struct.pack('ffffffffffffffff',
|
||||
|
|
Loading…
Reference in New Issue