mirror of
https://github.com/H-uru/korman.git
synced 2025-07-15 10:54:18 +00:00
Delay manipulating the selection
We may not be baking anything, so this can be a collosal waste of time. Observed speedups of several seconds in some ages.
This commit is contained in:
@ -331,7 +331,7 @@ class MeshConverter:
|
|||||||
return geospans
|
return geospans
|
||||||
|
|
||||||
def _export_static_lighting(self, bo):
|
def _export_static_lighting(self, bo):
|
||||||
helpers.make_active_selection(bo)
|
bpy.context.scene.objects.active = bo
|
||||||
mods = bo.plasma_modifiers
|
mods = bo.plasma_modifiers
|
||||||
lm = mods.lightmap
|
lm = mods.lightmap
|
||||||
if lm.enabled:
|
if lm.enabled:
|
||||||
|
@ -59,6 +59,10 @@ def ensure_object_can_bake(bo, toggle):
|
|||||||
toggle.track(bo, "hide_render", False)
|
toggle.track(bo, "hide_render", False)
|
||||||
toggle.track(bo, "hide_select", False)
|
toggle.track(bo, "hide_select", False)
|
||||||
|
|
||||||
|
# Ensure only this object is selected
|
||||||
|
for i in bpy.data.objects:
|
||||||
|
i.select = i == bo
|
||||||
|
|
||||||
def ensure_power_of_two(value):
|
def ensure_power_of_two(value):
|
||||||
return pow(2, math.floor(math.log(value, 2)))
|
return pow(2, math.floor(math.log(value, 2)))
|
||||||
|
|
||||||
@ -69,12 +73,3 @@ def find_modifier(boname, modid):
|
|||||||
# if they give us the wrong modid, it is a bug and an AttributeError
|
# if they give us the wrong modid, it is a bug and an AttributeError
|
||||||
return getattr(bo.plasma_modifiers, modid)
|
return getattr(bo.plasma_modifiers, modid)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def make_active_selection(bo):
|
|
||||||
"""Selects a single Blender Object and makes it active"""
|
|
||||||
for i in bpy.data.objects:
|
|
||||||
if i == bo:
|
|
||||||
bpy.context.scene.objects.active = i
|
|
||||||
i.select = True
|
|
||||||
else:
|
|
||||||
i.select = False
|
|
||||||
|
Reference in New Issue
Block a user