mirror of
https://github.com/3b1b/manim.git
synced 2025-07-29 21:12:35 +08:00
Merge pull request #1357 from parmentelat/master
handle_play_like_call decorator to use functools.wraps
This commit is contained in:
@ -3,6 +3,7 @@ import itertools as it
|
|||||||
import random
|
import random
|
||||||
import sys
|
import sys
|
||||||
import moderngl
|
import moderngl
|
||||||
|
from functools import wraps
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
@ -1287,6 +1288,7 @@ class Mobject(object):
|
|||||||
# Operations touching shader uniforms
|
# Operations touching shader uniforms
|
||||||
|
|
||||||
def affects_shader_info_id(func):
|
def affects_shader_info_id(func):
|
||||||
|
@wraps(func)
|
||||||
def wrapper(self):
|
def wrapper(self):
|
||||||
for mob in self.get_family():
|
for mob in self.get_family():
|
||||||
func(mob)
|
func(mob)
|
||||||
|
@ -2,7 +2,7 @@ import itertools as it
|
|||||||
import operator as op
|
import operator as op
|
||||||
import moderngl
|
import moderngl
|
||||||
|
|
||||||
from functools import reduce
|
from functools import reduce, wraps
|
||||||
|
|
||||||
from manimlib.constants import *
|
from manimlib.constants import *
|
||||||
from manimlib.mobject.mobject import Mobject
|
from manimlib.mobject.mobject import Mobject
|
||||||
@ -807,6 +807,7 @@ class VMobject(Mobject):
|
|||||||
return tri_indices
|
return tri_indices
|
||||||
|
|
||||||
def triggers_refreshed_triangulation(func):
|
def triggers_refreshed_triangulation(func):
|
||||||
|
@wraps(func)
|
||||||
def wrapper(self, *args, **kwargs):
|
def wrapper(self, *args, **kwargs):
|
||||||
old_points = self.get_points()
|
old_points = self.get_points()
|
||||||
func(self, *args, **kwargs)
|
func(self, *args, **kwargs)
|
||||||
|
@ -3,6 +3,7 @@ import random
|
|||||||
import platform
|
import platform
|
||||||
import itertools as it
|
import itertools as it
|
||||||
import logging
|
import logging
|
||||||
|
from functools import wraps
|
||||||
|
|
||||||
from tqdm import tqdm as ProgressDisplay
|
from tqdm import tqdm as ProgressDisplay
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@ -372,6 +373,7 @@ class Scene(object):
|
|||||||
return animations
|
return animations
|
||||||
|
|
||||||
def handle_play_like_call(func):
|
def handle_play_like_call(func):
|
||||||
|
@wraps(func)
|
||||||
def wrapper(self, *args, **kwargs):
|
def wrapper(self, *args, **kwargs):
|
||||||
self.update_skipping_status()
|
self.update_skipping_status()
|
||||||
should_write = not self.skip_animations
|
should_write = not self.skip_animations
|
||||||
|
Reference in New Issue
Block a user