feat: remove new particle systems

clean: remove logs
This commit is contained in:
Swann
2021-04-14 15:50:53 +02:00
parent 8e606068f3
commit 736c3df7c4

View File

@ -240,7 +240,7 @@ def find_geometry_nodes_dependencies(modifiers: bpy.types.bpy_prop_collection) -
# parameter = mod.get(inpt.identifier) # parameter = mod.get(inpt.identifier)
# if parameter and isinstance(parameter, bpy.types.ID): # if parameter and isinstance(parameter, bpy.types.ID):
# dependencies.append(parameter) # dependencies.append(parameter)
logging.info(dependencies)
return dependencies return dependencies
@ -439,18 +439,16 @@ class BlObject(BlDatablock):
mod for mod in target.modifiers if mod.type == 'PARTICLE_SYSTEM'] mod for mod in target.modifiers if mod.type == 'PARTICLE_SYSTEM']
for mod in particles_modifiers: for mod in particles_modifiers:
default = mod.particle_system.settings.name default = mod.particle_system.settings
dumped_particles = data['modifiers'][mod.name]['particle_system'] dumped_particles = data['modifiers'][mod.name]['particle_system']
loader.load(mod.particle_system, dumped_particles) loader.load(mod.particle_system, dumped_particles)
settings = get_datablock_from_uuid(dumped_particles['settings_uuid'], None) settings = get_datablock_from_uuid(dumped_particles['settings_uuid'], None)
if settings: if settings:
mod.particle_system.settings = settings mod.particle_system.settings = settings
# Hack to remove the default generated particle settings
# Hack to remove the default generated particle settings if not default.uuid:
for settings in bpy.data.particles: bpy.data.particles.remove(default)
if settings.users == 0:
bpy.data.particles.remove(settings)
phys_modifiers = [ phys_modifiers = [
mod for mod in target.modifiers if mod.type in ['SOFT_BODY', 'CLOTH']] mod for mod in target.modifiers if mod.type in ['SOFT_BODY', 'CLOTH']]