def checkPandaVersionOutOfDate(self, minDay, minMonth, minYear): """ Checks if the panda build is out of date, so users don't complain about stuff not working, because they simply didn't update """ built = PandaSystem.getBuildDate() formated = datetime.datetime.strptime(built, "%b %d %Y %H:%M:%S") required = datetime.datetime(minYear, minMonth, minDay, 00, 00) if formated < required: print "ERROR: Your Panda3D Build is out of date. Update to the latest" print "git build in order to use the pipeline: " print "https://github.com/panda3d/panda3d" sys.exit(0) # Check version versionMinMinor = 9 versionMinMajor = 1 versionMismatch = False if PandaSystem.getMajorVersion() < versionMinMajor: versionMismatch = True elif PandaSystem.getMinorVersion() < versionMinMinor: versionMismatch = True if versionMismatch: print "ERROR: Your current panda build (", PandaSystem.getVersionString( ), ") is" print "not supported! The minimum required build is", str( versionMinMajor) + "." + str(versionMinMinor) + ".0" sys.exit(0)
def checkPandaVersionOutOfDate(self, minDay, minMonth, minYear): """ Checks if the panda build is out of date, so users don't complain about stuff not working, because they simply didn't update """ built = PandaSystem.getBuildDate() formated = datetime.datetime.strptime(built, "%b %d %Y %H:%M:%S") required = datetime.datetime(minYear, minMonth, minDay, 12, 00) if formated < required: print "ERROR: Your Panda3D Build is out of date. Update to the latest" print "git build in order to use the pipeline: " print "https://github.com/panda3d/panda3d" sys.exit(0) # Check version versionMinMinor = 9 versionMinMajor = 1 versionMismatch = False if PandaSystem.getMajorVersion() < versionMinMajor: versionMismatch = True elif PandaSystem.getMinorVersion() < versionMinMinor: versionMismatch = True if versionMismatch: print "ERROR: Your current panda build (", PandaSystem.getVersionString(), ") is" print "not supported! The minimum required build is", str(versionMinMajor) + "." + str(versionMinMinor) + ".0" sys.exit(0)
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. from __future__ import print_function __all__ = ['PopupMenu', 'DropDownMenu'] from direct.showbase.DirectObject import DirectObject from direct.gui.DirectGui import DirectButton, DirectFrame, DGG, OnscreenText from direct.task import Task from panda3d.core import PandaSystem, loadPrcFileData from panda3d.core import NodePath, TextNode, PlaneNode, LineSegs, Texture, PNMImage, CardMaker from panda3d.core import Vec4, Point3, Vec3, Plane, Point2 from panda3d.core import Triangulator, GeomVertexData, GeomVertexFormat, GeomVertexWriter, Geom, GeomNode, GeomTriangles SEQUENCE_TYPES = (tuple, list) atLeast16 = PandaSystem.getMajorVersion() * 10 + PandaSystem.getMinorVersion( ) >= 16 asList = lambda nc: nc if atLeast16 else nc.asList() class DropDownMenu(DirectObject): ALeft = 0 ACenter = 1 ARight = 2 ENone = 0 EFade = 1 ESlide = 2 EStretch = 3 PLeft = 0 PRight = 1 PBottom = 2