diff --git a/direct/src/actor/Actor.py b/direct/src/actor/Actor.py index 8f5d5183e0..dbd1fd253e 100644 --- a/direct/src/actor/Actor.py +++ b/direct/src/actor/Actor.py @@ -1,7 +1,7 @@ """Actor module: contains the Actor class. -See the :ref:`models-and-actors` page in the Programming Guide to learn -more about loading models and animated actors. +See the :ref:`loading-actors-and-animations` page in the Programming Guide +to learn more about loading animated models. """ __all__ = ['Actor'] diff --git a/direct/src/actor/__init__.py b/direct/src/actor/__init__.py index 14d116777f..191aacd08f 100644 --- a/direct/src/actor/__init__.py +++ b/direct/src/actor/__init__.py @@ -5,6 +5,6 @@ the lower-level :class:`panda3d.core.Character` implementation. It loads and controls an animated character and manages the animations playing on it. -See the :ref:`models-and-actors` page in the Programming Guide to learn -more about loading models and animated actors. +See the :ref:`loading-actors-and-animations` page in the Programming Guide +to learn more about loading animated models. """ diff --git a/direct/src/gui/OnscreenImage.py b/direct/src/gui/OnscreenImage.py index 8f85613956..bb1494b60a 100644 --- a/direct/src/gui/OnscreenImage.py +++ b/direct/src/gui/OnscreenImage.py @@ -107,7 +107,9 @@ class OnscreenImage(DirectObject, NodePath): tex = image else: # It's a Texture file name - tex = base.loader.loadTexture(image) + tex = TexturePool.loadTexture(image) + if not tex: + raise IOError('Could not load texture: %s' % (image)) cm = CardMaker('OnscreenImage') cm.setFrame(-1, 1, -1, 1) self.assign(parent.attachNewNode(cm.generate(), sort)) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 145ffe19df..46401e9ed8 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -6121,7 +6121,7 @@ def ParallelMake(tasklist): # Create the workers for slave in range(THREADCOUNT): th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue]) - th.setDaemon(1) + th.daemon = True th.start() # Feed tasks to the workers. tasksqueued = 0 diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 2201ddbdc5..2e3bc76ed8 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -28,7 +28,7 @@ SUFFIX_LIB = [".lib",".ilb"] VCS_DIRS = set(["CVS", "CVSROOT", ".git", ".hg", "__pycache__"]) VCS_FILES = set([".cvsignore", ".gitignore", ".gitmodules", ".hgignore"]) STARTTIME = time.time() -MAINTHREAD = threading.currentThread() +MAINTHREAD = threading.current_thread() OUTPUTDIR = "built" CUSTOM_OUTPUTDIR = False THIRDPARTYBASE = None @@ -242,7 +242,7 @@ def ProgressOutput(progress, msg, target = None): sys.stdout.flush() sys.stderr.flush() prefix = "" - thisthread = threading.currentThread() + thisthread = threading.current_thread() if thisthread is MAINTHREAD: if progress is None: prefix = "" @@ -272,7 +272,7 @@ def ProgressOutput(progress, msg, target = None): def exit(msg = ""): sys.stdout.flush() sys.stderr.flush() - if threading.currentThread() == MAINTHREAD: + if threading.current_thread() == MAINTHREAD: SaveDependencyCache() print("Elapsed Time: " + PrettyTime(time.time() - STARTTIME)) print(msg) @@ -1556,8 +1556,8 @@ def PkgConfigGetIncDirs(pkgname, tool = "pkg-config"): else: handle = os.popen(LocateBinary(tool) + " --cflags") result = handle.read().strip() - if len(result) == 0: return [] handle.close() + if len(result) == 0: return [] dirs = [] for opt in result.split(" "): if (opt.startswith("-I")): @@ -3484,7 +3484,8 @@ def UpdatePythonVersionInfoFile(new_info): json_data = [] if os.path.isfile(json_file) and not PkgSkip("PYTHON"): try: - json_data = json.load(open(json_file, 'r')) + with open(json_file, 'r') as fh: + json_data = json.load(fh) except: json_data = [] @@ -3504,7 +3505,9 @@ def UpdatePythonVersionInfoFile(new_info): if VERBOSE: print("Writing %s" % (json_file)) - json.dump(json_data, open(json_file, 'w'), indent=4) + + with open(json_file, 'w') as fh: + json.dump(json_data, fh, indent=4) def ReadPythonVersionInfoFile(): diff --git a/panda/src/event/buttonEvent.h b/panda/src/event/buttonEvent.h index 9da453a827..d80eabf701 100644 --- a/panda/src/event/buttonEvent.h +++ b/panda/src/event/buttonEvent.h @@ -42,6 +42,9 @@ class DatagramIterator; * keyboard (and other buttons for which there is a corresponding ButtonHandle * object), while keystroke events are defined across the entire Unicode * character set. + * + * This API should not be considered stable and may change in a future version + * of Panda3D. */ class EXPCL_PANDA_EVENT ButtonEvent { PUBLISHED: diff --git a/panda/src/gobj/config_gobj.cxx b/panda/src/gobj/config_gobj.cxx index f3e8adbaf8..df0990f69f 100644 --- a/panda/src/gobj/config_gobj.cxx +++ b/panda/src/gobj/config_gobj.cxx @@ -520,7 +520,7 @@ PRC_DESC("If this is nonzero, it represents an artificial delay, " "in seconds, that is imposed on every asynchronous load attempt " "(within the thread). Its purpose is to help debug errors that " "may occur when an asynchronous load is delayed. The " - "delay is per-model, and all aync loads will be queued " + "delay is per-model, and all async loads will be queued " "up behind the delay--it is as if the time it takes to read a " "file is increased by this amount per read.")); diff --git a/pandatool/src/assimp/pandaLogger.cxx b/pandatool/src/assimp/pandaLogger.cxx index c9897533cf..ee0a41324e 100644 --- a/pandatool/src/assimp/pandaLogger.cxx +++ b/pandatool/src/assimp/pandaLogger.cxx @@ -40,6 +40,15 @@ void PandaLogger::OnDebug(const char *message) { } } +/** + * + */ +void PandaLogger::OnVerboseDebug(const char *message) { + if (assimp_cat.is_spam()) { + assimp_cat.spam() << message << "\n"; + } +} + /** * */ diff --git a/pandatool/src/assimp/pandaLogger.h b/pandatool/src/assimp/pandaLogger.h index dbd2165ce6..2fdbd44609 100644 --- a/pandatool/src/assimp/pandaLogger.h +++ b/pandatool/src/assimp/pandaLogger.h @@ -30,11 +30,17 @@ protected: INLINE bool attachStream(Assimp::LogStream*, unsigned int) { return false; }; + INLINE bool detachStream(Assimp::LogStream*, unsigned int) { + return false; + }; + + // Kept for compatibility with Assimp 4.x INLINE bool detatchStream(Assimp::LogStream*, unsigned int) { return false; }; void OnDebug(const char *message); + void OnVerboseDebug(const char *message); void OnError(const char *message); void OnInfo(const char *message); void OnWarn(const char *message);