diff --git a/direct/src/actor/Actor.py b/direct/src/actor/Actor.py index 7802ebc3eb..d5fcaa8ee4 100644 --- a/direct/src/actor/Actor.py +++ b/direct/src/actor/Actor.py @@ -24,6 +24,8 @@ class Actor(DirectObject, NodePath): LoaderOptions.LFConvertAnim) validateSubparts = ConfigVariableBool('validate-subparts', True) + mergeLODBundles = ConfigVariableBool('merge-lod-bundles', True) + allowAsyncBind = ConfigVariableBool('allow-async-bind', True) class PartDef: @@ -171,10 +173,10 @@ class Actor(DirectObject, NodePath): # ['common']; when it is false, __animControlDict has one key # per each LOD name. - if mergeLODBundles == None: + if mergeLODBundles is None: # If this isn't specified, it comes from the Config.prc # file. - self.mergeLODBundles = base.config.GetBool('merge-lod-bundles', True) + self.mergeLODBundles = Actor.mergeLODBundles.getValue() else: self.mergeLODBundles = mergeLODBundles @@ -182,8 +184,8 @@ class Actor(DirectObject, NodePath): # asynchronous animation binding. This requires that you have # run "egg-optchar -preload" on your animation and models to # generate the appropriate AnimPreloadTable. - if allowAsyncBind == None: - self.allowAsyncBind = base.config.GetBool('allow-async-bind', True) + if allowAsyncBind is None: + self.allowAsyncBind = Actor.allowAsyncBind.getValue() else: self.allowAsyncBind = allowAsyncBind diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index 8d20e1683d..ccd4de8800 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -1995,7 +1995,7 @@ def pstatcollect(scope, level = None): try: - if not (__dev__ or config.GetBool('force-pstatcollect', 0)) or \ + if not (__dev__ or ConfigVariableBool('force-pstatcollect', False)) or \ not scope: return decorator diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index 9e4f7a9296..54e18040b3 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -75,6 +75,8 @@ class ShowBase(DirectObject.DirectObject): if logStackDump or uploadStackDump: ExceptionVarDump.install(logStackDump, uploadStackDump) + self.__autoGarbageLogging = self.__dev__ and self.config.GetBool('auto-garbage-logging', False) + ## The directory containing the main Python file of this application. self.mainDir = ExecutionEnvironment.getEnvironmentVariable("MAIN_DIR") @@ -2665,7 +2667,7 @@ class ShowBase(DirectObject.DirectObject): if not properties.getOpen(): # If the user closes the main window, we should exit. self.notify.info("User closed main window.") - if __dev__ and config.GetBool('auto-garbage-logging', 0): + if self.__autoGarbageLogging: GarbageReport.b_checkForGarbageLeaks() self.userExit() @@ -2673,7 +2675,7 @@ class ShowBase(DirectObject.DirectObject): self.mainWinForeground = 1 elif not properties.getForeground() and self.mainWinForeground: self.mainWinForeground = 0 - if __dev__ and config.GetBool('auto-garbage-logging', 0): + if self.__autoGarbageLogging: GarbageReport.b_checkForGarbageLeaks() if properties.getMinimized() and not self.mainWinMinimized: diff --git a/direct/src/showbase/Transitions.py b/direct/src/showbase/Transitions.py index ca4919a48f..2f2db9592d 100644 --- a/direct/src/showbase/Transitions.py +++ b/direct/src/showbase/Transitions.py @@ -168,7 +168,7 @@ class Transitions: self.loadFade() self.fade.reparentTo(aspect2d, FADE_SORT_INDEX) self.fade.setColor(self.alphaOn) - elif base.config.GetBool('no-loading-screen',0): + elif ConfigVariableBool('no-loading-screen', False): if finishIval: self.transitionIval = finishIval self.transitionIval.start() diff --git a/direct/src/showutil/Rope.py b/direct/src/showutil/Rope.py index 9f4a3b1c90..922c681631 100644 --- a/direct/src/showutil/Rope.py +++ b/direct/src/showutil/Rope.py @@ -10,7 +10,8 @@ class Rope(NodePath): thick lines built from triangle strips. """ - showRope = base.config.GetBool('show-rope', 1) + showRope = ConfigVariableBool('show-rope', True, \ + "Set this to false to deactivate the display of ropes.") def __init__(self, name = 'Rope'): self.ropeNode = RopeNode(name) @@ -18,6 +19,9 @@ class Rope(NodePath): self.ropeNode.setCurve(self.curve) NodePath.__init__(self, self.ropeNode) self.name = name + self.order = 0 + self.verts = [] + self.knots = None def setup(self, order, verts, knots = None): """This must be called to define the shape of the curve