Page MenuHome

Unwrap Menu (U) -> Lightmap Pack throws Python Exception
Closed, InvalidPublicPATCH


I was trying to unwrap one mesh (I am attaching blend file) and was using shortcut U -> Lightmap Pack. It threw Python Exception:

Traceback (most recent call last):
File "/MY-PATH/2.58/scripts/startup/bl_operators/", line 578, in execute
return unwrap(self, context, **kwargs)
File "/MY-PATH/2.58/scripts/startup/bl_operators/", line 526, in unwrap
lightmap_uvpack(meshes, **kwargs)
File "/MY-PATH/2.58/scripts/startup/bl_operators/", line 409, in lightmap_uvpack
for d, boxes in odd_dict.items():
RuntimeError: dictionary changed size during iteration

Script was changed dicts while iterating them. So I fixed this script and I am attaching the patch.

Event Timeline

The patch changes functionality from the original functionality a bit, since it was the intention not to loop on newly added items.
so apply a more simple fix r38212.

Campbell Barton (campbellbarton) changed the task status from Unknown Status to Unknown Status.Jul 8 2011, 5:08 AM