From 29294cb9749a6497fd5babb60bcfaf0ba6aeb0d9 Mon Sep 17 00:00:00 2001 From: Epihaius Date: Mon, 1 Nov 2021 15:48:04 +0100 Subject: [PATCH] interval: Redefine some properties in MetaInterval class The `play_rate` property invokes the underlying C++ `set_play_rate` method, which leads to a bug (#1202). The property is now redefined to make it invoke the overriding `MetaInterval.set_play_rate` method instead. Fixes #1202 Closes #1204 --- direct/src/interval/MetaInterval.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/direct/src/interval/MetaInterval.py b/direct/src/interval/MetaInterval.py index 4f31c9839d..8c2e26908f 100644 --- a/direct/src/interval/MetaInterval.py +++ b/direct/src/interval/MetaInterval.py @@ -348,10 +348,14 @@ class MetaInterval(CMetaInterval): def getManager(self): return self.__manager + manager = property(getManager, setManager) + def setT(self, t): self.__updateIvals() CMetaInterval.setT(self, t) + t = property(CMetaInterval.getT, setT) + def start(self, startT = 0.0, endT = -1.0, playRate = 1.0): self.__updateIvals() self.setupPlay(startT, endT, playRate, 0) @@ -475,6 +479,8 @@ class MetaInterval(CMetaInterval): else: CMetaInterval.setPlayRate(self, playRate) + play_rate = property(CMetaInterval.getPlayRate, setPlayRate) + def __doPythonCallbacks(self): # This function invokes any Python-level Intervals that need # to be invoked at this point in time. It must be called @@ -549,6 +555,8 @@ class MetaInterval(CMetaInterval): self.__updateIvals() return CMetaInterval.getDuration(self) + duration = property(getDuration) + def __repr__(self, *args, **kw): # This function overrides from the parent level to force it to # update the interval list first, if necessary.