|
13 | 13 | import random
|
14 | 14 | import threading
|
15 | 15 | import time
|
16 |
| -import types |
17 | 16 | from queue import Queue
|
18 | 17 |
|
19 | 18 | import srt
|
@@ -127,8 +126,6 @@ def __init__(
|
127 | 126 | self.widgets = []
|
128 | 127 | self.dearpygui_imported = dearpygui_imported
|
129 | 128 | self.updaters = []
|
130 |
| - self.point_lights = [] |
131 |
| - self.ambient_light = None |
132 | 129 | self.key_to_function_map = {}
|
133 | 130 | self.mouse_press_callbacks = []
|
134 | 131 | self.interactive_mode = False
|
@@ -175,52 +172,7 @@ def __deepcopy__(self, clone_from_id):
|
175 | 172 | if k == "camera_class":
|
176 | 173 | setattr(result, k, v)
|
177 | 174 | setattr(result, k, copy.deepcopy(v, clone_from_id))
|
178 |
| - result.mobject_updater_lists = [] |
179 | 175 |
|
180 |
| - # Update updaters |
181 |
| - for mobject in self.mobjects: |
182 |
| - cloned_updaters = [] |
183 |
| - for updater in mobject.updaters: |
184 |
| - # Make the cloned updater use the cloned Mobjects as free variables |
185 |
| - # rather than the original ones. Analyzing function bytecode with the |
186 |
| - # dis module will help in understanding this. |
187 |
| - # https://docs.python.org/3/library/dis.html |
188 |
| - # TODO: Do the same for function calls recursively. |
189 |
| - free_variable_map = inspect.getclosurevars(updater).nonlocals |
190 |
| - cloned_co_freevars = [] |
191 |
| - cloned_closure = [] |
192 |
| - for free_variable_name in updater.__code__.co_freevars: |
193 |
| - free_variable_value = free_variable_map[free_variable_name] |
194 |
| - |
195 |
| - # If the referenced variable has not been cloned, raise. |
196 |
| - if id(free_variable_value) not in clone_from_id: |
197 |
| - raise Exception( |
198 |
| - f"{free_variable_name} is referenced from an updater " |
199 |
| - "but is not an attribute of the Scene, which isn't " |
200 |
| - "allowed.", |
201 |
| - ) |
202 |
| - |
203 |
| - # Add the cloned object's name to the free variable list. |
204 |
| - cloned_co_freevars.append(free_variable_name) |
205 |
| - |
206 |
| - # Add a cell containing the cloned object's reference to the |
207 |
| - # closure list. |
208 |
| - cloned_closure.append( |
209 |
| - types.CellType(clone_from_id[id(free_variable_value)]), |
210 |
| - ) |
211 |
| - |
212 |
| - cloned_updater = types.FunctionType( |
213 |
| - updater.__code__.replace(co_freevars=tuple(cloned_co_freevars)), |
214 |
| - updater.__globals__, |
215 |
| - updater.__name__, |
216 |
| - updater.__defaults__, |
217 |
| - tuple(cloned_closure), |
218 |
| - ) |
219 |
| - cloned_updaters.append(cloned_updater) |
220 |
| - mobject_clone = clone_from_id[id(mobject)] |
221 |
| - mobject_clone.updaters = cloned_updaters |
222 |
| - if len(cloned_updaters) > 0: |
223 |
| - result.mobject_updater_lists.append((mobject_clone, cloned_updaters)) |
224 | 176 | return result
|
225 | 177 |
|
226 | 178 | def render(self, preview: bool = False):
|
|
0 commit comments