forked from LeenkxTeam/LNXSDK
Merge pull request 't3du [ Repe ] - Fix particle export' (#78) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#78
This commit is contained in:
@ -151,7 +151,7 @@ class LeenkxExporter:
|
||||
self.default_part_material_objects = []
|
||||
self.material_to_lnx_object_dict = {}
|
||||
# Stores the link between a blender object and its
|
||||
# corresponding export data (arm object)
|
||||
# corresponding export data (lnx object)
|
||||
self.object_to_lnx_object_dict: Dict[bpy.types.Object, Dict] = {}
|
||||
|
||||
self.bone_tracks = []
|
||||
@ -540,8 +540,14 @@ class LeenkxExporter:
|
||||
o['material_refs'].append(lnx.utils.asset_name(material))
|
||||
|
||||
def export_particle_system_ref(self, psys: bpy.types.ParticleSystem, out_object):
|
||||
if psys.settings.instance_object is None or psys.settings.render_type != 'OBJECT' or not psys.settings.instance_object.lnx_export or not bpy.data.objects[out_object['name']].modifiers[psys.name].show_render:
|
||||
if psys.settings.instance_object is None or psys.settings.render_type != 'OBJECT' or not psys.settings.instance_object.lnx_export:
|
||||
return
|
||||
|
||||
for mod in bpy.data.objects[out_object['name']].modifiers:
|
||||
if mod.type == 'PARTICLE_SYSTEM':
|
||||
if mod.particle_system.name == psys.name:
|
||||
if not mod.show_render:
|
||||
return
|
||||
|
||||
self.particle_system_array[psys.settings] = {"structName": psys.settings.name}
|
||||
pref = {
|
||||
@ -917,8 +923,12 @@ class LeenkxExporter:
|
||||
out_object['particle_refs'] = []
|
||||
out_object['render_emitter'] = bobject.show_instancer_for_render
|
||||
for i in range(num_psys):
|
||||
if bobject.modifiers[bobject.particle_systems[i].name].show_render:
|
||||
self.export_particle_system_ref(bobject.particle_systems[i], out_object)
|
||||
for obj in bpy.data.objects:
|
||||
for mod in obj.modifiers:
|
||||
if mod.type == 'PARTICLE_SYSTEM':
|
||||
if mod.particle_system.name == bobject.particle_systems[i].name:
|
||||
if mod.show_render:
|
||||
self.export_particle_system_ref(bobject.particle_systems[i], out_object)
|
||||
|
||||
aabb = bobject.data.lnx_aabb
|
||||
if aabb[0] == 0 and aabb[1] == 0 and aabb[2] == 0:
|
||||
@ -2293,7 +2303,7 @@ class LeenkxExporter:
|
||||
for mod in obj.modifiers:
|
||||
if mod.type == 'PARTICLE_SYSTEM':
|
||||
if mod.particle_system.settings.name == particleRef[1]["structName"]:
|
||||
if mod.show_render == True:
|
||||
if mod.show_render:
|
||||
padd = True
|
||||
if not padd:
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user