@volter/blender-engine 0.1.39 → 0.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/session.py +5 -1
- package/package.json +1 -1
package/browser/session.py
CHANGED
|
@@ -1412,10 +1412,14 @@ class Session:
|
|
|
1412
1412
|
# automatic one is the evaluated bounds the presenter already holds.
|
|
1413
1413
|
if graphs:
|
|
1414
1414
|
depsgraph = bpy.context.evaluated_depsgraph_get()
|
|
1415
|
+
# BY NAME THROUGH ONE MAP: `scene.objects.get` searches the collection linearly, so a
|
|
1416
|
+
# lookup per row was quadratic -- measured on the Stoneguard file (11,702 rows): 11,343
|
|
1417
|
+
# calls, 14.4 s of every present.
|
|
1418
|
+
by_name = {obj.name: obj for obj in scene.objects}
|
|
1415
1419
|
for row in frame["objects"]:
|
|
1416
1420
|
if not any(m in graphs for m in row["materials"] if m is not None):
|
|
1417
1421
|
continue
|
|
1418
|
-
obj =
|
|
1422
|
+
obj = by_name.get(row["name"])
|
|
1419
1423
|
data = obj.evaluated_get(depsgraph).data if obj is not None else None
|
|
1420
1424
|
if getattr(data, "use_auto_texspace", True) is False:
|
|
1421
1425
|
row["texspace"] = [[float(v) for v in data.texspace_location],
|