mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 23:34:57 -04:00
direct: Cut down on usage of import *
(#1454)
* Remove most `import *`s in `direct` * Address feedback
This commit is contained in:
parent
81f7a21845
commit
c7c70bc32a
@ -6,7 +6,29 @@ to learn more about loading animated models.
|
||||
|
||||
__all__ = ['Actor']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import (
|
||||
AnimBundleNode,
|
||||
AnimControlCollection,
|
||||
Character,
|
||||
ConfigVariableBool,
|
||||
DecalEffect,
|
||||
Filename,
|
||||
GlobPattern,
|
||||
LineStream,
|
||||
LoaderOptions,
|
||||
LODNode,
|
||||
ModelNode,
|
||||
MovingPartBase,
|
||||
MovingPartMatrix,
|
||||
NodePath,
|
||||
PandaNode,
|
||||
PartBundle,
|
||||
PartSubset,
|
||||
Point3,
|
||||
TransformState,
|
||||
Vec3,
|
||||
autoBind,
|
||||
)
|
||||
from panda3d.core import Loader as PandaLoader
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from direct.showbase.Loader import Loader
|
||||
|
@ -1,8 +1,26 @@
|
||||
"""ClusterClient: Master for multi-piping or PC clusters."""
|
||||
|
||||
from panda3d.core import *
|
||||
from .ClusterMsgs import *
|
||||
from .ClusterConfig import *
|
||||
from panda3d.core import (
|
||||
ClockObject,
|
||||
ConnectionWriter,
|
||||
Point3,
|
||||
QueuedConnectionManager,
|
||||
QueuedConnectionReader,
|
||||
VBase3,
|
||||
Vec3,
|
||||
decomposeMatrix,
|
||||
)
|
||||
from .ClusterMsgs import (
|
||||
CLUSTER_DAEMON_PORT,
|
||||
CLUSTER_NAMED_MOVEMENT_DONE,
|
||||
CLUSTER_NAMED_OBJECT_MOVEMENT,
|
||||
CLUSTER_NONE,
|
||||
CLUSTER_SERVER_PORT,
|
||||
CLUSTER_SWAP_READY,
|
||||
SERVER_STARTUP_STRING,
|
||||
ClusterMsgHandler,
|
||||
)
|
||||
from .ClusterConfig import ClientConfigs
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.showbase import DirectObject
|
||||
from direct.task import Task
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from .ClusterClient import *
|
||||
from panda3d.core import Vec3
|
||||
|
||||
#: A dictionary of information for various cluster configurations.
|
||||
#: Dictionary is keyed on cluster-config string
|
||||
|
@ -3,7 +3,7 @@
|
||||
# This module is intended to supply routines and dataformats common to
|
||||
# both ClusterClient and ClusterServer.
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import NetDatagram
|
||||
from direct.distributed.PyDatagram import PyDatagram
|
||||
from direct.distributed.PyDatagramIterator import PyDatagramIterator
|
||||
import time
|
||||
|
@ -1,6 +1,30 @@
|
||||
from panda3d.core import *
|
||||
from .ClusterMsgs import *
|
||||
from direct.distributed.MsgTypes import *
|
||||
from panda3d.core import (
|
||||
ClockObject,
|
||||
ConnectionWriter,
|
||||
NetAddress,
|
||||
PointerToConnection,
|
||||
QueuedConnectionListener,
|
||||
QueuedConnectionManager,
|
||||
QueuedConnectionReader,
|
||||
Vec3,
|
||||
)
|
||||
from .ClusterMsgs import (
|
||||
CLUSTER_CAM_FRUSTUM,
|
||||
CLUSTER_CAM_MOVEMENT,
|
||||
CLUSTER_CAM_OFFSET,
|
||||
CLUSTER_COMMAND_STRING,
|
||||
CLUSTER_DAEMON_PORT,
|
||||
CLUSTER_EXIT,
|
||||
CLUSTER_NAMED_MOVEMENT_DONE,
|
||||
CLUSTER_NAMED_OBJECT_MOVEMENT,
|
||||
CLUSTER_NONE,
|
||||
CLUSTER_SELECTED_MOVEMENT,
|
||||
CLUSTER_SERVER_PORT,
|
||||
CLUSTER_SWAP_NOW,
|
||||
CLUSTER_SWAP_READY,
|
||||
CLUSTER_TIME_DATA,
|
||||
ClusterMsgHandler,
|
||||
)
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.showbase import DirectObject
|
||||
from direct.task import Task
|
||||
|
@ -2,7 +2,7 @@
|
||||
from direct.showbase.InputStateGlobal import inputState
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
from direct.task.Task import Task
|
||||
from panda3d.core import *
|
||||
from panda3d.core import ClockObject, Mat3, Point3, Vec3
|
||||
from . import GravityWalker
|
||||
|
||||
BattleStrafe = 0
|
||||
|
@ -22,7 +22,7 @@ from direct.showbase import DirectObject
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
from direct.task.Task import Task
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from panda3d.core import *
|
||||
from panda3d.core import ClockObject, ConfigVariableBool, ConfigVariableDouble, Mat3, Point3, Vec3
|
||||
|
||||
|
||||
class DevWalker(DirectObject.DirectObject):
|
||||
|
@ -24,7 +24,22 @@ from direct.task.Task import Task
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from direct.extensions_native import VBase3_extensions
|
||||
from direct.extensions_native import VBase4_extensions
|
||||
from panda3d.core import *
|
||||
from panda3d.core import (
|
||||
BitMask32,
|
||||
ClockObject,
|
||||
CollisionHandlerEvent,
|
||||
CollisionHandlerFluidPusher,
|
||||
CollisionHandlerGravity,
|
||||
CollisionHandlerPusher,
|
||||
CollisionNode,
|
||||
CollisionRay,
|
||||
CollisionSphere,
|
||||
CollisionTraverser,
|
||||
ConfigVariableBool,
|
||||
Mat3,
|
||||
Point3,
|
||||
Vec3,
|
||||
)
|
||||
import math
|
||||
|
||||
|
||||
|
@ -23,7 +23,20 @@ from direct.showbase.InputStateGlobal import inputState
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
from direct.task.Task import Task
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from panda3d.core import *
|
||||
from panda3d.core import (
|
||||
BitMask32,
|
||||
ClockObject,
|
||||
CollisionHandlerFloor,
|
||||
CollisionHandlerPusher,
|
||||
CollisionNode,
|
||||
CollisionRay,
|
||||
CollisionSphere,
|
||||
CollisionTraverser,
|
||||
ConfigVariableBool,
|
||||
Mat3,
|
||||
Point3,
|
||||
Vec3,
|
||||
)
|
||||
|
||||
class NonPhysicsWalker(DirectObject.DirectObject):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory("NonPhysicsWalker")
|
||||
|
@ -16,7 +16,13 @@ although it does send messages that allow a listener to play sounds or
|
||||
animations based on walker events.
|
||||
"""
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import (
|
||||
BitMask32,
|
||||
CollisionHandlerPusher,
|
||||
CollisionNode,
|
||||
CollisionSphere,
|
||||
CollisionTraverser,
|
||||
)
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
from . import NonPhysicsWalker
|
||||
|
||||
|
@ -26,8 +26,31 @@ from direct.task.TaskManagerGlobal import taskMgr
|
||||
from direct.extensions_native import Mat3_extensions
|
||||
from direct.extensions_native import VBase3_extensions
|
||||
from direct.extensions_native import VBase4_extensions
|
||||
from panda3d.core import *
|
||||
from panda3d.physics import *
|
||||
from panda3d.core import (
|
||||
BitMask32,
|
||||
ClockObject,
|
||||
CollisionHandlerFloor,
|
||||
CollisionHandlerQueue,
|
||||
CollisionNode,
|
||||
CollisionRay,
|
||||
CollisionSphere,
|
||||
CollisionTraverser,
|
||||
ConfigVariableBool,
|
||||
LRotationf,
|
||||
Mat3,
|
||||
NodePath,
|
||||
Point3,
|
||||
Vec3,
|
||||
)
|
||||
from panda3d.physics import (
|
||||
ActorNode,
|
||||
ForceNode,
|
||||
LinearEulerIntegrator,
|
||||
LinearFrictionForce,
|
||||
LinearVectorForce,
|
||||
PhysicsCollisionHandler,
|
||||
PhysicsManager,
|
||||
)
|
||||
import math
|
||||
|
||||
#import LineStream
|
||||
|
@ -2,9 +2,12 @@
|
||||
TwoDWalker.py is for controlling the avatars in a 2D scroller game environment.
|
||||
"""
|
||||
|
||||
from .GravityWalker import *
|
||||
from .GravityWalker import GravityWalker
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from direct.showbase.InputStateGlobal import inputState
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
from panda3d.core import ConfigVariableBool
|
||||
from direct.task.Task import Task
|
||||
from panda3d.core import ConfigVariableBool, Vec3
|
||||
|
||||
|
||||
class TwoDWalker(GravityWalker):
|
||||
|
@ -1,8 +1,7 @@
|
||||
print('TestStart: Starting up test environment.')
|
||||
|
||||
from panda3d.core import *
|
||||
import direct.showbase.PythonUtil # pylint: disable=unused-import
|
||||
|
||||
from direct.showbase.PythonUtil import *
|
||||
from direct.showbase import ShowBase
|
||||
base = ShowBase.ShowBase()
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
|
||||
print('ThreeUpStart: Starting up environment.')
|
||||
|
||||
from panda3d.core import *
|
||||
import direct.showbase.PythonUtil # pylint: disable=unused-import
|
||||
|
||||
from direct.showbase.PythonUtil import *
|
||||
from direct.showbase import ThreeUpShow
|
||||
|
||||
base = ThreeUpShow.ThreeUpShow()
|
||||
|
@ -1,8 +1,15 @@
|
||||
"""Class used to create and control VRPN devices."""
|
||||
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from panda3d.core import *
|
||||
from panda3d.vrpn import *
|
||||
from panda3d.core import (
|
||||
AnalogNode,
|
||||
ButtonNode,
|
||||
ConfigVariableDouble,
|
||||
ConfigVariableString,
|
||||
DialNode,
|
||||
TrackerNode,
|
||||
)
|
||||
from panda3d.vrpn import VrpnClient
|
||||
|
||||
ANALOG_MIN = -0.95
|
||||
ANALOG_MAX = 0.95
|
||||
|
@ -1,8 +1,9 @@
|
||||
""" Class used to create and control radamec device """
|
||||
from panda3d.core import Vec3
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from direct.task.Task import Task
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from .DirectDeviceManager import *
|
||||
from .DirectDeviceManager import DirectDeviceManager
|
||||
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
""" Class used to create and control joybox device """
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from .DirectDeviceManager import *
|
||||
from direct.directtools.DirectUtil import *
|
||||
from .DirectDeviceManager import ANALOG_DEADBAND, ANALOG_MAX, ANALOG_MIN, DirectDeviceManager
|
||||
from direct.directtools.DirectUtil import CLAMP
|
||||
from direct.gui import OnscreenText
|
||||
from direct.task import Task
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from panda3d.core import ClockObject
|
||||
from panda3d.core import ButtonRegistry, ButtonThrower, ClockObject, NodePath, VBase3, Vec3
|
||||
|
||||
import math
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
""" Class used to create and control radamec device """
|
||||
from math import *
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from direct.task.Task import Task
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from .DirectDeviceManager import *
|
||||
from .DirectDeviceManager import DirectDeviceManager
|
||||
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
|
||||
|
@ -11,7 +11,15 @@
|
||||
import os
|
||||
import sys
|
||||
import gc
|
||||
from panda3d.core import *
|
||||
from panda3d.core import (
|
||||
BamCache,
|
||||
ExecutionEnvironment,
|
||||
Filename,
|
||||
Loader,
|
||||
LoaderOptions,
|
||||
ModelPool,
|
||||
TexturePool,
|
||||
)
|
||||
|
||||
class EggCacher:
|
||||
def __init__(self, args):
|
||||
|
@ -1,7 +1,9 @@
|
||||
import math
|
||||
from panda3d.core import BitMask32, Mat4, NodePath, Point3, VBase3, Vec3, Vec4, rad2Deg
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from .DirectUtil import *
|
||||
from .DirectGeometry import *
|
||||
from .DirectGlobals import *
|
||||
from .DirectUtil import CLAMP, useDirectRenderStyle
|
||||
from .DirectGeometry import getCrankAngle, getScreenXY
|
||||
from . import DirectGlobals as DG
|
||||
from .DirectSelection import SelectionRay
|
||||
from direct.interval.IntervalGlobal import Sequence, Func
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
@ -218,9 +220,9 @@ class DirectCameraControl(DirectObject):
|
||||
# Allow intersection with unpickable objects
|
||||
# And then spawn task to determine mouse mode
|
||||
# Don't intersect with hidden or backfacing objects
|
||||
skipFlags = SKIP_HIDDEN | SKIP_BACKFACE
|
||||
skipFlags = DG.SKIP_HIDDEN | DG.SKIP_BACKFACE
|
||||
# Skip camera (and its children), unless control key is pressed
|
||||
skipFlags |= SKIP_CAMERA * (1 - base.getControl())
|
||||
skipFlags |= DG.SKIP_CAMERA * (1 - base.getControl())
|
||||
self.computeCOA(base.direct.iRay.pickGeom(skipFlags = skipFlags))
|
||||
# Record reference point
|
||||
self.coaMarkerRef.setPosHprScale(base.cam, 0, 0, 0, 0, 0, 0, 1, 1, 1)
|
||||
@ -422,7 +424,7 @@ class DirectCameraControl(DirectObject):
|
||||
|
||||
# Set at markers position in render coordinates
|
||||
self.camManipRef.setPos(self.coaMarkerPos)
|
||||
self.camManipRef.setHpr(base.direct.camera, ZERO_POINT)
|
||||
self.camManipRef.setHpr(base.direct.camera, DG.ZERO_POINT)
|
||||
t = Task.Task(self.mouseRotateTask)
|
||||
if abs(base.direct.dr.mouseX) > 0.9:
|
||||
t.constrainedDir = 'y'
|
||||
@ -454,7 +456,7 @@ class DirectCameraControl(DirectObject):
|
||||
# flatten roll
|
||||
base.direct.camera.setR(0)
|
||||
self.camManipRef.setPos(self.coaMarkerPos)
|
||||
self.camManipRef.setHpr(base.direct.camera, ZERO_POINT)
|
||||
self.camManipRef.setHpr(base.direct.camera, DG.ZERO_POINT)
|
||||
else:
|
||||
if base.direct.camera.getPos().getZ() >=0 or not self.switchDirBelowZero:
|
||||
dirX = -1
|
||||
@ -478,7 +480,7 @@ class DirectCameraControl(DirectObject):
|
||||
self.__stopManipulateCamera()
|
||||
# Set at markers position in render coordinates
|
||||
self.camManipRef.setPos(self.coaMarkerPos)
|
||||
self.camManipRef.setHpr(base.direct.camera, ZERO_POINT)
|
||||
self.camManipRef.setHpr(base.direct.camera, DG.ZERO_POINT)
|
||||
t = Task.Task(self.mouseRollTask)
|
||||
t.coaCenter = getScreenXY(self.coaMarker)
|
||||
t.lastAngle = getCrankAngle(t.coaCenter)
|
||||
@ -565,7 +567,7 @@ class DirectCameraControl(DirectObject):
|
||||
base.direct.message('COA Distance: ' + repr(dist))
|
||||
coa.set(0, dist, 0)
|
||||
# Compute COA Dist
|
||||
coaDist = Vec3(coa - ZERO_POINT).length()
|
||||
coaDist = Vec3(coa - DG.ZERO_POINT).length()
|
||||
if coaDist < (1.1 * dr.near):
|
||||
coa.set(0, 100, 0)
|
||||
coaDist = 100
|
||||
@ -575,7 +577,7 @@ class DirectCameraControl(DirectObject):
|
||||
def updateCoa(self, ref2point, coaDist = None, ref = None):
|
||||
self.coa.set(ref2point[0], ref2point[1], ref2point[2])
|
||||
if not coaDist:
|
||||
coaDist = Vec3(self.coa - ZERO_POINT).length()
|
||||
coaDist = Vec3(self.coa - DG.ZERO_POINT).length()
|
||||
# Place the marker in render space
|
||||
if ref is None:
|
||||
# KEH: use the current display region
|
||||
@ -642,19 +644,19 @@ class DirectCameraControl(DirectObject):
|
||||
# Transform camera z axis to render space
|
||||
mCam2Render = Mat4(Mat4.identMat()) # [gjeon] fixed to give required argument
|
||||
mCam2Render.assign(base.direct.camera.getMat(render))
|
||||
zAxis = Vec3(mCam2Render.xformVec(Z_AXIS))
|
||||
zAxis = Vec3(mCam2Render.xformVec(DG.Z_AXIS))
|
||||
zAxis.normalize()
|
||||
# Compute rotation angle needed to upright cam
|
||||
orbitAngle = rad2Deg(math.acos(CLAMP(zAxis.dot(Z_AXIS), -1, 1)))
|
||||
orbitAngle = rad2Deg(math.acos(CLAMP(zAxis.dot(DG.Z_AXIS), -1, 1)))
|
||||
# Check angle
|
||||
if orbitAngle < 0.1:
|
||||
# Already upright
|
||||
return
|
||||
# Compute orthogonal axis of rotation
|
||||
rotAxis = Vec3(zAxis.cross(Z_AXIS))
|
||||
rotAxis = Vec3(zAxis.cross(DG.Z_AXIS))
|
||||
rotAxis.normalize()
|
||||
# Find angle between rot Axis and render X_AXIS
|
||||
rotAngle = rad2Deg(math.acos(CLAMP(rotAxis.dot(X_AXIS), -1, 1)))
|
||||
rotAngle = rad2Deg(math.acos(CLAMP(rotAxis.dot(DG.X_AXIS), -1, 1)))
|
||||
# Determine sign or rotation angle
|
||||
if rotAxis[1] < 0:
|
||||
rotAngle *= -1
|
||||
@ -685,7 +687,7 @@ class DirectCameraControl(DirectObject):
|
||||
base.direct.pushUndo([base.direct.camera])
|
||||
# Determine marker location
|
||||
markerToCam = self.coaMarker.getPos(base.direct.camera)
|
||||
dist = Vec3(markerToCam - ZERO_POINT).length()
|
||||
dist = Vec3(markerToCam - DG.ZERO_POINT).length()
|
||||
scaledCenterVec = Y_AXIS * dist
|
||||
delta = markerToCam - scaledCenterVec
|
||||
self.camManipRef.setPosHpr(base.direct.camera, Point3(0), Point3(0))
|
||||
@ -709,7 +711,7 @@ class DirectCameraControl(DirectObject):
|
||||
self.camManipRef.setPos(base.direct.camera, zoomPtToCam)
|
||||
# Move to that point
|
||||
ival = base.direct.camera.posInterval(CAM_MOVE_DURATION,
|
||||
ZERO_POINT,
|
||||
DG.ZERO_POINT,
|
||||
other = self.camManipRef,
|
||||
blendType = 'easeInOut')
|
||||
ival = Sequence(ival, Func(self.updateCoaMarkerSizeOnDeath),
|
||||
@ -746,20 +748,20 @@ class DirectCameraControl(DirectObject):
|
||||
elif view == 7:
|
||||
hprOffset.set(135., -35.264, 0.)
|
||||
# Position target
|
||||
self.camManipRef.setPosHpr(self.coaMarker, ZERO_VEC,
|
||||
self.camManipRef.setPosHpr(self.coaMarker, DG.ZERO_VEC,
|
||||
hprOffset)
|
||||
# Scale center vec by current distance to target
|
||||
offsetDistance = Vec3(base.direct.camera.getPos(self.camManipRef) -
|
||||
ZERO_POINT).length()
|
||||
DG.ZERO_POINT).length()
|
||||
scaledCenterVec = Y_AXIS * (-1.0 * offsetDistance)
|
||||
# Now put the camManipRef at that point
|
||||
self.camManipRef.setPosHpr(self.camManipRef,
|
||||
scaledCenterVec,
|
||||
ZERO_VEC)
|
||||
DG.ZERO_VEC)
|
||||
# Record view for next time around
|
||||
self.lastView = view
|
||||
ival = base.direct.camera.posHprInterval(CAM_MOVE_DURATION,
|
||||
pos = ZERO_POINT,
|
||||
pos = DG.ZERO_POINT,
|
||||
hpr = VBase3(0, 0, self.orthoViewRoll),
|
||||
other = self.camManipRef,
|
||||
blendType = 'easeInOut')
|
||||
@ -776,9 +778,9 @@ class DirectCameraControl(DirectObject):
|
||||
base.direct.pushUndo([base.direct.camera])
|
||||
|
||||
# Coincident with widget
|
||||
self.camManipRef.setPos(self.coaMarker, ZERO_POINT)
|
||||
self.camManipRef.setPos(self.coaMarker, DG.ZERO_POINT)
|
||||
# But aligned with render space
|
||||
self.camManipRef.setHpr(ZERO_POINT)
|
||||
self.camManipRef.setHpr(DG.ZERO_POINT)
|
||||
|
||||
parent = base.direct.camera.getParent()
|
||||
base.direct.camera.wrtReparentTo(self.camManipRef)
|
||||
|
@ -1,7 +1,21 @@
|
||||
|
||||
from panda3d.core import *
|
||||
from .DirectGlobals import *
|
||||
from .DirectUtil import *
|
||||
from panda3d.core import (
|
||||
CSDefault,
|
||||
GeomNode,
|
||||
LineSegs,
|
||||
Mat4,
|
||||
NodePath,
|
||||
Point3,
|
||||
Quat,
|
||||
VBase3,
|
||||
VBase4,
|
||||
Vec3,
|
||||
composeMatrix,
|
||||
decomposeMatrix,
|
||||
deg2Rad,
|
||||
rad2Deg,
|
||||
)
|
||||
from .DirectGlobals import Q_EPSILON, UNIT_VEC, ZERO_VEC
|
||||
from .DirectUtil import CLAMP
|
||||
import math
|
||||
|
||||
class LineNodePath(NodePath):
|
||||
|
@ -1,8 +1,8 @@
|
||||
|
||||
from panda3d.core import *
|
||||
import math
|
||||
from panda3d.core import NodePath, Point3, VBase4
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from .DirectUtil import *
|
||||
from .DirectGeometry import *
|
||||
from .DirectUtil import ROUND_TO, useDirectRenderStyle
|
||||
from .DirectGeometry import LineNodePath
|
||||
|
||||
|
||||
class DirectGrid(NodePath, DirectObject):
|
||||
|
@ -1,5 +1,15 @@
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import (
|
||||
AmbientLight,
|
||||
DirectionalLight,
|
||||
LightAttrib,
|
||||
Material,
|
||||
NodePath,
|
||||
PerspectiveLens,
|
||||
PointLight,
|
||||
Spotlight,
|
||||
VBase4,
|
||||
)
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
|
||||
|
||||
|
@ -1,10 +1,32 @@
|
||||
import math
|
||||
from panda3d.core import (
|
||||
BitMask32,
|
||||
BoundingHexahedron,
|
||||
CSDefault,
|
||||
Mat4,
|
||||
NodePath,
|
||||
Point3,
|
||||
VBase3,
|
||||
VBase4,
|
||||
Vec3,
|
||||
decomposeMatrix,
|
||||
deg2Rad,
|
||||
)
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
from .DirectGlobals import *
|
||||
from .DirectUtil import *
|
||||
from .DirectGeometry import *
|
||||
from . import DirectGlobals as DG
|
||||
from .DirectUtil import useDirectRenderStyle
|
||||
from .DirectGeometry import (
|
||||
LineNodePath,
|
||||
getCrankAngle,
|
||||
getNearProjectionPoint,
|
||||
getScreenXY,
|
||||
planeIntersect,
|
||||
relHpr,
|
||||
)
|
||||
from .DirectSelection import SelectionRay
|
||||
from direct.task import Task
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from copy import deepcopy
|
||||
|
||||
|
||||
@ -51,7 +73,7 @@ class DirectManipulationControl(DirectObject):
|
||||
['shift-f', self.objectHandles.growToFit],
|
||||
['i', self.plantSelectedNodePath],
|
||||
]
|
||||
self.defaultSkipFlags = SKIP_HIDDEN | SKIP_BACKFACE
|
||||
self.defaultSkipFlags = DG.SKIP_HIDDEN | DG.SKIP_BACKFACE
|
||||
self.optionalSkipFlags = 0
|
||||
self.unmovableTagList = []
|
||||
|
||||
@ -115,7 +137,7 @@ class DirectManipulationControl(DirectObject):
|
||||
self.fScaling3D == 0:
|
||||
|
||||
# Check for a widget hit point
|
||||
entry = base.direct.iRay.pickWidget(skipFlags = SKIP_WIDGET)
|
||||
entry = base.direct.iRay.pickWidget(skipFlags = DG.SKIP_WIDGET)
|
||||
# Did we hit a widget?
|
||||
if entry:
|
||||
# Yes!
|
||||
@ -137,7 +159,7 @@ class DirectManipulationControl(DirectObject):
|
||||
if entry:
|
||||
# Check to see if we are moving the object
|
||||
# We are moving the object if we either wait long enough
|
||||
taskMgr.doMethodLater(MANIPULATION_MOVE_DELAY,
|
||||
taskMgr.doMethodLater(DG.MANIPULATION_MOVE_DELAY,
|
||||
self.switchToMoveMode,
|
||||
'manip-move-wait')
|
||||
# Or we move far enough
|
||||
@ -213,7 +235,7 @@ class DirectManipulationControl(DirectObject):
|
||||
self.marquee.create()
|
||||
|
||||
if self.fMultiView:
|
||||
LE_showInOneCam(self.marquee, base.direct.camera.getName())
|
||||
DG.LE_showInOneCam(self.marquee, base.direct.camera.getName())
|
||||
|
||||
def manipulationStop(self):
|
||||
taskMgr.remove('manipulateObject')
|
||||
@ -227,7 +249,7 @@ class DirectManipulationControl(DirectObject):
|
||||
# optionally specified things
|
||||
skipFlags = self.defaultSkipFlags | self.optionalSkipFlags
|
||||
# Skip camera (and its children), unless control key is pressed
|
||||
skipFlags |= SKIP_CAMERA * (1 - base.getControl())
|
||||
skipFlags |= DG.SKIP_CAMERA * (1 - base.getControl())
|
||||
|
||||
if self.marquee:
|
||||
self.marquee.removeNode()
|
||||
@ -269,18 +291,18 @@ class DirectManipulationControl(DirectObject):
|
||||
|
||||
selectionList = []
|
||||
for geom in render.findAllMatches("**/+GeomNode"):
|
||||
if (skipFlags & SKIP_HIDDEN) and geom.isHidden():
|
||||
if (skipFlags & DG.SKIP_HIDDEN) and geom.isHidden():
|
||||
# Skip if hidden node
|
||||
continue
|
||||
## elif (skipFlags & SKIP_BACKFACE) and base.direct.iRay.isEntryBackfacing():
|
||||
## elif (skipFlags & DG.SKIP_BACKFACE) and base.direct.iRay.isEntryBackfacing():
|
||||
## # Skip, if backfacing poly
|
||||
## pass
|
||||
elif (skipFlags & SKIP_CAMERA) and \
|
||||
elif (skipFlags & DG.SKIP_CAMERA) and \
|
||||
(base.camera in geom.getAncestors()):
|
||||
# Skip if parented to a camera.
|
||||
continue
|
||||
# Can pick unpickable, use the first visible node
|
||||
elif (skipFlags & SKIP_UNPICKABLE) and \
|
||||
elif (skipFlags & DG.SKIP_UNPICKABLE) and \
|
||||
(geom.getName() in base.direct.iRay.unpickable):
|
||||
# Skip if in unpickable list
|
||||
continue
|
||||
@ -500,7 +522,7 @@ class DirectManipulationControl(DirectObject):
|
||||
selectedList = base.direct.selected.getSelectedAsList()
|
||||
# See if any of the selected are completely uneditable
|
||||
editTypes = self.getEditTypes(selectedList)
|
||||
if (editTypes & EDIT_TYPE_UNEDITABLE) == EDIT_TYPE_UNEDITABLE:
|
||||
if (editTypes & DG.EDIT_TYPE_UNEDITABLE) == DG.EDIT_TYPE_UNEDITABLE:
|
||||
return
|
||||
self.currEditTypes = editTypes
|
||||
if selectedList:
|
||||
@ -568,13 +590,13 @@ class DirectManipulationControl(DirectObject):
|
||||
if self.constraint:
|
||||
type = self.constraint[2:]
|
||||
if self.useSeparateScaleHandles:
|
||||
if type == 'post' and not self.currEditTypes & EDIT_TYPE_UNMOVABLE:
|
||||
if type == 'post' and not self.currEditTypes & DG.EDIT_TYPE_UNMOVABLE:
|
||||
self.xlate1D(state)
|
||||
elif type == 'disc' and not self.currEditTypes & EDIT_TYPE_UNMOVABLE:
|
||||
elif type == 'disc' and not self.currEditTypes & DG.EDIT_TYPE_UNMOVABLE:
|
||||
self.xlate2D(state)
|
||||
elif type == 'ring' and not self.currEditTypes & EDIT_TYPE_UNROTATABLE:
|
||||
elif type == 'ring' and not self.currEditTypes & DG.EDIT_TYPE_UNROTATABLE:
|
||||
self.rotate1D(state)
|
||||
elif type == 'scale' and not self.currEditTypes & EDIT_TYPE_UNSCALABLE:
|
||||
elif type == 'scale' and not self.currEditTypes & DG.EDIT_TYPE_UNSCALABLE:
|
||||
if base.direct.fShift:
|
||||
self.fScaling3D = 1
|
||||
self.scale3D(state)
|
||||
@ -582,7 +604,7 @@ class DirectManipulationControl(DirectObject):
|
||||
self.fScaling1D = 1
|
||||
self.scale1D(state)
|
||||
else:
|
||||
if base.direct.fControl and not self.currEditTypes & EDIT_TYPE_UNSCALABLE:
|
||||
if base.direct.fControl and not self.currEditTypes & DG.EDIT_TYPE_UNSCALABLE:
|
||||
if type == 'post':
|
||||
# [gjeon] non-uniform scaling
|
||||
self.fScaling1D = 1
|
||||
@ -592,11 +614,11 @@ class DirectManipulationControl(DirectObject):
|
||||
self.fScaling3D = 1
|
||||
self.scale3D(state)
|
||||
else:
|
||||
if type == 'post' and not self.currEditTypes & EDIT_TYPE_UNMOVABLE:
|
||||
if type == 'post' and not self.currEditTypes & DG.EDIT_TYPE_UNMOVABLE:
|
||||
self.xlate1D(state)
|
||||
elif type == 'disc' and not self.currEditTypes & EDIT_TYPE_UNMOVABLE:
|
||||
elif type == 'disc' and not self.currEditTypes & DG.EDIT_TYPE_UNMOVABLE:
|
||||
self.xlate2D(state)
|
||||
elif type == 'ring' and not self.currEditTypes & EDIT_TYPE_UNROTATABLE:
|
||||
elif type == 'ring' and not self.currEditTypes & DG.EDIT_TYPE_UNROTATABLE:
|
||||
self.rotate1D(state)
|
||||
# No widget interaction, determine free manip mode
|
||||
elif self.fFreeManip and not self.useSeparateScaleHandles:
|
||||
@ -610,17 +632,17 @@ class DirectManipulationControl(DirectObject):
|
||||
self.fScaling1D = 0
|
||||
self.fScaling3D = 0
|
||||
# Alt key switches to a scaling mode
|
||||
if base.direct.fControl and not self.currEditTypes & EDIT_TYPE_UNSCALABLE:
|
||||
if base.direct.fControl and not self.currEditTypes & DG.EDIT_TYPE_UNSCALABLE:
|
||||
self.fScaling3D = 1
|
||||
self.scale3D(state)
|
||||
# Otherwise, manip mode depends on where you started
|
||||
elif state.fMouseX and state.fMouseY and not self.currEditTypes & EDIT_TYPE_UNROTATABLE:
|
||||
elif state.fMouseX and state.fMouseY and not self.currEditTypes & DG.EDIT_TYPE_UNROTATABLE:
|
||||
# In the corner, spin around camera's axis
|
||||
self.rotateAboutViewVector(state)
|
||||
elif state.fMouseX or state.fMouseY and not self.currEditTypes & EDIT_TYPE_UNMOVABLE:
|
||||
elif state.fMouseX or state.fMouseY and not self.currEditTypes & DG.EDIT_TYPE_UNMOVABLE:
|
||||
# Mouse started elsewhere in the outer frame, rotate
|
||||
self.rotate2D(state)
|
||||
elif not self.currEditTypes & EDIT_TYPE_UNMOVABLE:
|
||||
elif not self.currEditTypes & DG.EDIT_TYPE_UNMOVABLE:
|
||||
# Mouse started in central region, xlate
|
||||
# Mode depends on shift key
|
||||
if base.direct.fShift or base.direct.fControl:
|
||||
@ -805,11 +827,11 @@ class DirectManipulationControl(DirectObject):
|
||||
widgetDir.normalize()
|
||||
# Convert specified widget axis to view space
|
||||
if axis == 'x':
|
||||
widgetAxis = Vec3(mWidget2Cam.xformVec(X_AXIS))
|
||||
widgetAxis = Vec3(mWidget2Cam.xformVec(DG.X_AXIS))
|
||||
elif axis == 'y':
|
||||
widgetAxis = Vec3(mWidget2Cam.xformVec(Y_AXIS))
|
||||
widgetAxis = Vec3(mWidget2Cam.xformVec(DG.Y_AXIS))
|
||||
elif axis == 'z':
|
||||
widgetAxis = Vec3(mWidget2Cam.xformVec(Z_AXIS))
|
||||
widgetAxis = Vec3(mWidget2Cam.xformVec(DG.Z_AXIS))
|
||||
widgetAxis.normalize()
|
||||
if type == 'top?':
|
||||
# Check sign of angle between two vectors
|
||||
@ -868,7 +890,7 @@ class DirectManipulationControl(DirectObject):
|
||||
moveDir.assign(moveDir * -1)
|
||||
moveDir.normalize()
|
||||
else:
|
||||
moveDir = Vec3(Y_AXIS)
|
||||
moveDir = Vec3(DG.Y_AXIS)
|
||||
# Move selected objects
|
||||
dr = base.direct.dr
|
||||
# Scale move dir
|
||||
@ -1043,7 +1065,7 @@ class DirectManipulationControl(DirectObject):
|
||||
""" Move selected object to intersection point of cursor on scene """
|
||||
# Check for intersection
|
||||
entry = base.direct.iRay.pickGeom(
|
||||
skipFlags = SKIP_HIDDEN | SKIP_BACKFACE | SKIP_CAMERA)
|
||||
skipFlags = DG.SKIP_HIDDEN | DG.SKIP_BACKFACE | DG.SKIP_CAMERA)
|
||||
# MRM: Need to handle moving COA
|
||||
if entry is not None and base.direct.selected.last is not None:
|
||||
# Record undo point
|
||||
@ -1642,32 +1664,32 @@ class ObjectHandles(NodePath, DirectObject):
|
||||
# by comparing lineDir with plane normals. The plane with the
|
||||
# largest dotProduct is most "normal"
|
||||
if axis == 'x':
|
||||
if abs(lineDir.dot(Y_AXIS)) > abs(lineDir.dot(Z_AXIS)):
|
||||
if abs(lineDir.dot(DG.Y_AXIS)) > abs(lineDir.dot(DG.Z_AXIS)):
|
||||
self.hitPt.assign(
|
||||
planeIntersect(lineOrigin, lineDir, ORIGIN, Y_AXIS))
|
||||
planeIntersect(lineOrigin, lineDir, DG.ORIGIN, DG.Y_AXIS))
|
||||
else:
|
||||
self.hitPt.assign(
|
||||
planeIntersect(lineOrigin, lineDir, ORIGIN, Z_AXIS))
|
||||
planeIntersect(lineOrigin, lineDir, DG.ORIGIN, DG.Z_AXIS))
|
||||
# We really only care about the nearest point on the axis
|
||||
self.hitPt.setY(0)
|
||||
self.hitPt.setZ(0)
|
||||
elif axis == 'y':
|
||||
if abs(lineDir.dot(X_AXIS)) > abs(lineDir.dot(Z_AXIS)):
|
||||
if abs(lineDir.dot(DG.X_AXIS)) > abs(lineDir.dot(DG.Z_AXIS)):
|
||||
self.hitPt.assign(
|
||||
planeIntersect(lineOrigin, lineDir, ORIGIN, X_AXIS))
|
||||
planeIntersect(lineOrigin, lineDir, DG.ORIGIN, DG.X_AXIS))
|
||||
else:
|
||||
self.hitPt.assign(
|
||||
planeIntersect(lineOrigin, lineDir, ORIGIN, Z_AXIS))
|
||||
planeIntersect(lineOrigin, lineDir, DG.ORIGIN, DG.Z_AXIS))
|
||||
# We really only care about the nearest point on the axis
|
||||
self.hitPt.setX(0)
|
||||
self.hitPt.setZ(0)
|
||||
elif axis == 'z':
|
||||
if abs(lineDir.dot(X_AXIS)) > abs(lineDir.dot(Y_AXIS)):
|
||||
if abs(lineDir.dot(DG.X_AXIS)) > abs(lineDir.dot(DG.Y_AXIS)):
|
||||
self.hitPt.assign(
|
||||
planeIntersect(lineOrigin, lineDir, ORIGIN, X_AXIS))
|
||||
planeIntersect(lineOrigin, lineDir, DG.ORIGIN, DG.X_AXIS))
|
||||
else:
|
||||
self.hitPt.assign(
|
||||
planeIntersect(lineOrigin, lineDir, ORIGIN, Y_AXIS))
|
||||
planeIntersect(lineOrigin, lineDir, DG.ORIGIN, DG.Y_AXIS))
|
||||
# We really only care about the nearest point on the axis
|
||||
self.hitPt.setX(0)
|
||||
self.hitPt.setY(0)
|
||||
@ -1722,13 +1744,13 @@ class ObjectHandles(NodePath, DirectObject):
|
||||
# Find the hit point
|
||||
if plane == 'x':
|
||||
self.hitPt.assign(planeIntersect(
|
||||
lineOrigin, lineDir, ORIGIN, X_AXIS))
|
||||
lineOrigin, lineDir, DG.ORIGIN, DG.X_AXIS))
|
||||
elif plane == 'y':
|
||||
self.hitPt.assign(planeIntersect(
|
||||
lineOrigin, lineDir, ORIGIN, Y_AXIS))
|
||||
lineOrigin, lineDir, DG.ORIGIN, DG.Y_AXIS))
|
||||
elif plane == 'z':
|
||||
self.hitPt.assign(planeIntersect(
|
||||
lineOrigin, lineDir, ORIGIN, Z_AXIS))
|
||||
lineOrigin, lineDir, DG.ORIGIN, DG.Z_AXIS))
|
||||
|
||||
return self.hitPt
|
||||
|
||||
|
@ -1,8 +1,26 @@
|
||||
from panda3d.core import (
|
||||
BitMask32,
|
||||
BoundingSphere,
|
||||
CollisionHandlerQueue,
|
||||
CollisionNode,
|
||||
CollisionRay,
|
||||
CollisionSegment,
|
||||
CollisionSphere,
|
||||
CollisionTraverser,
|
||||
GeomNode,
|
||||
Mat4,
|
||||
NodePath,
|
||||
Point3,
|
||||
TransformState,
|
||||
VBase4,
|
||||
Vec3,
|
||||
Vec4,
|
||||
)
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
from .DirectGlobals import *
|
||||
from .DirectUtil import *
|
||||
from .DirectGeometry import *
|
||||
from . import DirectGlobals as DG
|
||||
from .DirectUtil import useDirectRenderStyle
|
||||
from .DirectGeometry import LineNodePath
|
||||
|
||||
COA_ORIGIN = 0
|
||||
COA_CENTER = 1
|
||||
@ -439,7 +457,7 @@ class SelectionQueue(CollisionHandlerQueue):
|
||||
# Current index and entry in collision queue
|
||||
self.index = -1
|
||||
self.entry = None
|
||||
self.skipFlags = SKIP_NONE
|
||||
self.skipFlags = DG.SKIP_NONE
|
||||
# Create a collision node path attached to the given NP
|
||||
self.collisionNodePath = NodePath(CollisionNode("collisionNP"))
|
||||
self.setParentNP(parentNP)
|
||||
@ -454,7 +472,7 @@ class SelectionQueue(CollisionHandlerQueue):
|
||||
# Let the traverser know about the collision node and the queue
|
||||
self.ct.addCollider(self.collisionNodePath, self)
|
||||
# List of objects that can't be selected
|
||||
self.unpickable = UNPICKABLE
|
||||
self.unpickable = DG.UNPICKABLE
|
||||
# Derived class must add Collider to complete initialization
|
||||
|
||||
def setParentNP(self, parentNP):
|
||||
@ -548,10 +566,10 @@ class SelectionQueue(CollisionHandlerQueue):
|
||||
v.normalize()
|
||||
return v.dot(n) >= 0
|
||||
|
||||
def findNextCollisionEntry(self, skipFlags = SKIP_NONE):
|
||||
def findNextCollisionEntry(self, skipFlags = DG.SKIP_NONE):
|
||||
return self.findCollisionEntry(skipFlags, self.index + 1)
|
||||
|
||||
def findCollisionEntry(self, skipFlags = SKIP_NONE, startIndex = 0):
|
||||
def findCollisionEntry(self, skipFlags = DG.SKIP_NONE, startIndex = 0):
|
||||
# Init self.index and self.entry
|
||||
self.setCurrentIndex(-1)
|
||||
self.setCurrentEntry(None)
|
||||
@ -559,28 +577,28 @@ class SelectionQueue(CollisionHandlerQueue):
|
||||
for i in range(startIndex, self.getNumEntries()):
|
||||
entry = self.getEntry(i)
|
||||
nodePath = entry.getIntoNodePath()
|
||||
if (skipFlags & SKIP_HIDDEN) and nodePath.isHidden():
|
||||
if (skipFlags & DG.SKIP_HIDDEN) and nodePath.isHidden():
|
||||
# Skip if hidden node
|
||||
pass
|
||||
elif (skipFlags & SKIP_BACKFACE) and self.isEntryBackfacing(entry):
|
||||
elif (skipFlags & DG.SKIP_BACKFACE) and self.isEntryBackfacing(entry):
|
||||
# Skip, if backfacing poly
|
||||
pass
|
||||
elif (skipFlags & SKIP_CAMERA) and \
|
||||
elif (skipFlags & DG.SKIP_CAMERA) and \
|
||||
(base.camera in nodePath.getAncestors()):
|
||||
# Skip if parented to a camera.
|
||||
pass
|
||||
# Can pick unpickable, use the first visible node
|
||||
elif (skipFlags & SKIP_UNPICKABLE) and\
|
||||
elif (skipFlags & DG.SKIP_UNPICKABLE) and\
|
||||
(nodePath.getName() in self.unpickable):
|
||||
# Skip if in unpickable list
|
||||
pass
|
||||
elif base.direct and\
|
||||
((skipFlags & SKIP_WIDGET) and
|
||||
((skipFlags & DG.SKIP_WIDGET) and
|
||||
(nodePath.getTag('WidgetName') != base.direct.widget.getName())):
|
||||
# Skip if this widget part is not belong to current widget
|
||||
pass
|
||||
elif base.direct and\
|
||||
((skipFlags & SKIP_WIDGET) and base.direct.fControl and
|
||||
((skipFlags & DG.SKIP_WIDGET) and base.direct.fControl and
|
||||
(nodePath.getName()[2:] == 'ring')):
|
||||
# Skip when ununiformly scale in ortho view
|
||||
pass
|
||||
@ -623,7 +641,7 @@ class SelectionRay(SelectionQueue):
|
||||
|
||||
def pickBitMask(self, bitMask = BitMask32.allOff(),
|
||||
targetNodePath = None,
|
||||
skipFlags = SKIP_ALL):
|
||||
skipFlags = DG.SKIP_ALL):
|
||||
if targetNodePath is None:
|
||||
targetNodePath = render
|
||||
self.collideWithBitMask(bitMask)
|
||||
@ -631,7 +649,7 @@ class SelectionRay(SelectionQueue):
|
||||
# Determine collision entry
|
||||
return self.findCollisionEntry(skipFlags)
|
||||
|
||||
def pickGeom(self, targetNodePath = None, skipFlags = SKIP_ALL,
|
||||
def pickGeom(self, targetNodePath = None, skipFlags = DG.SKIP_ALL,
|
||||
xy = None):
|
||||
if targetNodePath is None:
|
||||
targetNodePath = render
|
||||
@ -640,7 +658,7 @@ class SelectionRay(SelectionQueue):
|
||||
# Determine collision entry
|
||||
return self.findCollisionEntry(skipFlags)
|
||||
|
||||
def pickWidget(self, targetNodePath = None, skipFlags = SKIP_NONE):
|
||||
def pickWidget(self, targetNodePath = None, skipFlags = DG.SKIP_NONE):
|
||||
if targetNodePath is None:
|
||||
targetNodePath = render
|
||||
self.collideWithWidget()
|
||||
@ -657,7 +675,7 @@ class SelectionRay(SelectionQueue):
|
||||
|
||||
def pickGeom3D(self, targetNodePath = None,
|
||||
origin = Point3(0), dir = Vec3(0, 0, -1),
|
||||
skipFlags = SKIP_HIDDEN | SKIP_CAMERA):
|
||||
skipFlags = DG.SKIP_HIDDEN | DG.SKIP_CAMERA):
|
||||
if targetNodePath is None:
|
||||
targetNodePath = render
|
||||
self.collideWithGeom()
|
||||
@ -668,7 +686,7 @@ class SelectionRay(SelectionQueue):
|
||||
def pickBitMask3D(self, bitMask = BitMask32.allOff(),
|
||||
targetNodePath = None,
|
||||
origin = Point3(0), dir = Vec3(0, 0, -1),
|
||||
skipFlags = SKIP_ALL):
|
||||
skipFlags = DG.SKIP_ALL):
|
||||
if targetNodePath is None:
|
||||
targetNodePath = render
|
||||
self.collideWithBitMask(bitMask)
|
||||
@ -698,7 +716,7 @@ class SelectionSegment(SelectionQueue):
|
||||
self.numColliders += 1
|
||||
|
||||
def pickGeom(self, targetNodePath = None, endPointList = [],
|
||||
skipFlags = SKIP_HIDDEN | SKIP_CAMERA):
|
||||
skipFlags = DG.SKIP_HIDDEN | DG.SKIP_CAMERA):
|
||||
if targetNodePath is None:
|
||||
targetNodePath = render
|
||||
self.collideWithGeom()
|
||||
@ -713,7 +731,7 @@ class SelectionSegment(SelectionQueue):
|
||||
|
||||
def pickBitMask(self, bitMask = BitMask32.allOff(),
|
||||
targetNodePath = None, endPointList = [],
|
||||
skipFlags = SKIP_HIDDEN | SKIP_CAMERA):
|
||||
skipFlags = DG.SKIP_HIDDEN | DG.SKIP_CAMERA):
|
||||
if targetNodePath is None:
|
||||
targetNodePath = render
|
||||
self.collideWithBitMask(bitMask)
|
||||
@ -781,7 +799,7 @@ class SelectionSphere(SelectionQueue):
|
||||
return self.findCollisionEntry(skipFlags)
|
||||
|
||||
def pickGeom(self, targetNodePath = None,
|
||||
skipFlags = SKIP_HIDDEN | SKIP_CAMERA):
|
||||
skipFlags = DG.SKIP_HIDDEN | DG.SKIP_CAMERA):
|
||||
if targetNodePath is None:
|
||||
targetNodePath = render
|
||||
self.collideWithGeom()
|
||||
@ -789,7 +807,7 @@ class SelectionSphere(SelectionQueue):
|
||||
|
||||
def pickBitMask(self, bitMask = BitMask32.allOff(),
|
||||
targetNodePath = None,
|
||||
skipFlags = SKIP_HIDDEN | SKIP_CAMERA):
|
||||
skipFlags = DG.SKIP_HIDDEN | DG.SKIP_CAMERA):
|
||||
if targetNodePath is None:
|
||||
targetNodePath = render
|
||||
self.collideWithBitMask(bitMask)
|
||||
|
@ -1,13 +1,27 @@
|
||||
import math
|
||||
|
||||
from panda3d.core import *
|
||||
from .DirectUtil import *
|
||||
from panda3d.core import (
|
||||
CollisionNode,
|
||||
ConfigVariableBool,
|
||||
ConfigVariableString,
|
||||
CSDefault,
|
||||
NodePath,
|
||||
Point3,
|
||||
TextNode,
|
||||
VBase3,
|
||||
VBase4,
|
||||
Vec3,
|
||||
Vec4,
|
||||
decomposeMatrix,
|
||||
deg2Rad,
|
||||
)
|
||||
from .DirectUtil import useDirectRenderStyle
|
||||
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from direct.showbase.BulletinBoardGlobal import bulletinBoard as bboard
|
||||
from direct.task import Task
|
||||
|
||||
from .DirectGlobals import DIRECT_NO_MOD
|
||||
from . import DirectGlobals as DG
|
||||
from .DirectCameraControl import DirectCameraControl
|
||||
from .DirectManipulation import DirectManipulationControl
|
||||
from .DirectSelection import SelectionRay, COA_ORIGIN, SelectedNodePaths
|
||||
@ -20,7 +34,8 @@ from direct.cluster.ClusterServer import ClusterServer
|
||||
## from direct.tkwidgets import Slider
|
||||
## from direct.tkwidgets import SceneGraphExplorer
|
||||
from direct.gui import OnscreenText
|
||||
from direct.interval.IntervalGlobal import *
|
||||
from direct.interval.IntervalGlobal import Func, Sequence
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
|
||||
class DirectSession(DirectObject):
|
||||
|
||||
@ -541,7 +556,7 @@ class DirectSession(DirectObject):
|
||||
base.mouseWatcher = winCtrl.mouseWatcher
|
||||
base.mouseWatcherNode = winCtrl.mouseWatcher.node()
|
||||
base.direct.dr.mouseUpdate()
|
||||
LE_showInOneCam(self.selectedNPReadout, self.camera.getName())
|
||||
DG.LE_showInOneCam(self.selectedNPReadout, self.camera.getName())
|
||||
base.direct.widget = base.direct.manipulationControl.widgetList[base.camList.index(NodePath(winCtrl.camNode))]
|
||||
|
||||
input = input[8:] # get rid of camera prefix
|
||||
@ -590,8 +605,8 @@ class DirectSession(DirectObject):
|
||||
self.fControl = 1
|
||||
# [gjeon] to update control key information while mouse1 is pressed
|
||||
if self.fMouse1:
|
||||
modifiers = DIRECT_NO_MOD
|
||||
modifiers |= DIRECT_CONTROL_MOD
|
||||
modifiers = DG.DIRECT_NO_MOD
|
||||
modifiers |= DG.DIRECT_CONTROL_MOD
|
||||
messenger.send('DIRECT-mouse1', sentArgs = [modifiers])
|
||||
elif input == 'control-up':
|
||||
self.fControl = 0
|
||||
@ -601,16 +616,16 @@ class DirectSession(DirectObject):
|
||||
self.fAlt = 1
|
||||
# [gjeon] to update alt key information while mouse1 is pressed
|
||||
if self.fMouse1:
|
||||
modifiers = DIRECT_NO_MOD
|
||||
modifiers |= DIRECT_ALT_MOD
|
||||
modifiers = DG.DIRECT_NO_MOD
|
||||
modifiers |= DG.DIRECT_ALT_MOD
|
||||
messenger.send('DIRECT-mouse1', sentArgs = [modifiers])
|
||||
elif self.fMouse2:
|
||||
modifiers = DIRECT_NO_MOD
|
||||
modifiers |= DIRECT_ALT_MOD
|
||||
modifiers = DG.DIRECT_NO_MOD
|
||||
modifiers |= DG.DIRECT_ALT_MOD
|
||||
messenger.send('DIRECT-mouse2', sentArgs = [modifiers])
|
||||
elif self.fMouse3:
|
||||
modifiers = DIRECT_NO_MOD
|
||||
modifiers |= DIRECT_ALT_MOD
|
||||
modifiers = DG.DIRECT_NO_MOD
|
||||
modifiers |= DG.DIRECT_ALT_MOD
|
||||
messenger.send('DIRECT-mouse3', sentArgs = [modifiers])
|
||||
elif input == 'alt-up':
|
||||
self.fAlt = 0
|
||||
@ -637,24 +652,24 @@ class DirectSession(DirectObject):
|
||||
self.select(self.selected.last)
|
||||
|
||||
def getModifiers(self, input, base):
|
||||
modifiers = DIRECT_NO_MOD
|
||||
modifiers = DG.DIRECT_NO_MOD
|
||||
modifierString = input[: input.find(base)]
|
||||
if modifierString.find('shift') != -1:
|
||||
modifiers |= DIRECT_SHIFT_MOD
|
||||
modifiers |= DG.DIRECT_SHIFT_MOD
|
||||
if modifierString.find('control') != -1:
|
||||
modifiers |= DIRECT_CONTROL_MOD
|
||||
modifiers |= DG.DIRECT_CONTROL_MOD
|
||||
if modifierString.find('alt') != -1:
|
||||
modifiers |= DIRECT_ALT_MOD
|
||||
modifiers |= DG.DIRECT_ALT_MOD
|
||||
return modifiers
|
||||
|
||||
def gotShift(self, modifiers):
|
||||
return modifiers & DIRECT_SHIFT_MOD
|
||||
return modifiers & DG.DIRECT_SHIFT_MOD
|
||||
|
||||
def gotControl(self, modifiers):
|
||||
return modifiers & DIRECT_CONTROL_MOD
|
||||
return modifiers & DG.DIRECT_CONTROL_MOD
|
||||
|
||||
def gotAlt(self, modifiers):
|
||||
return modifiers & DIRECT_ALT_MOD
|
||||
return modifiers & DG.DIRECT_ALT_MOD
|
||||
|
||||
def setFScaleWidgetByCam(self, flag):
|
||||
self.fScaleWidgetByCam = flag
|
||||
@ -708,7 +723,7 @@ class DirectSession(DirectObject):
|
||||
else:
|
||||
self.widget.showWidget()
|
||||
editTypes = self.manipulationControl.getEditTypes([dnp])
|
||||
if (editTypes & EDIT_TYPE_UNEDITABLE) == EDIT_TYPE_UNEDITABLE:
|
||||
if (editTypes & DG.EDIT_TYPE_UNEDITABLE) == DG.EDIT_TYPE_UNEDITABLE:
|
||||
self.manipulationControl.disableWidgetMove()
|
||||
else:
|
||||
self.manipulationControl.enableWidgetMove()
|
||||
@ -831,7 +846,7 @@ class DirectSession(DirectObject):
|
||||
# Temporarily set node path color
|
||||
nodePath.setColor(flashColor)
|
||||
# Clean up color in a few seconds
|
||||
t = taskMgr.doMethodLater(DIRECT_FLASH_DURATION,
|
||||
t = taskMgr.doMethodLater(DG.DIRECT_FLASH_DURATION,
|
||||
# This is just a dummy task
|
||||
self.flashDummy,
|
||||
'flashNodePath',)
|
||||
@ -1272,7 +1287,7 @@ class DisplayRegionList(DirectObject):
|
||||
for dr in self.displayRegionList:
|
||||
dr.setVfov(fov)
|
||||
|
||||
def mouseUpdate(self, modifiers = DIRECT_NO_MOD):
|
||||
def mouseUpdate(self, modifiers = DG.DIRECT_NO_MOD):
|
||||
for dr in self.displayRegionList:
|
||||
dr.mouseUpdate()
|
||||
#base.direct.dr = self.getCurrentDr()
|
||||
|
@ -1,5 +1,3 @@
|
||||
|
||||
from .DirectGlobals import *
|
||||
from panda3d.core import VBase4
|
||||
from direct.task.Task import Task
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
|
@ -1,8 +1,20 @@
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
from direct.directtools.DirectGeometry import *
|
||||
from direct.directtools.DirectUtil import CLAMP
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
|
||||
from panda3d.core import NodePath, LineSegs, ClockObject
|
||||
from panda3d.core import (
|
||||
PCTHPR,
|
||||
PCTNONE,
|
||||
PCTT,
|
||||
PCTXYZ,
|
||||
ClockObject,
|
||||
LineSegs,
|
||||
NodePath,
|
||||
ParametricCurve,
|
||||
Point3,
|
||||
Vec3,
|
||||
)
|
||||
|
||||
|
||||
class Mopath(DirectObject):
|
||||
|
2
direct/src/dist/FreezeTool.py
vendored
2
direct/src/dist/FreezeTool.py
vendored
@ -22,7 +22,7 @@ try:
|
||||
except ImportError:
|
||||
p3extend_frozen = None
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import Filename, Multifile, PandaSystem, StringStream
|
||||
|
||||
# Check to see if we are running python_d, which implies we have a
|
||||
# debug build, and we have to build the module with debug options.
|
||||
|
2
direct/src/dist/icon.py
vendored
2
direct/src/dist/icon.py
vendored
@ -1,4 +1,4 @@
|
||||
from direct.directnotify.DirectNotifyGlobal import *
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from panda3d.core import PNMImage, Filename, PNMFileTypeRegistry, StringStream
|
||||
import struct
|
||||
|
||||
|
@ -2,7 +2,8 @@
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
from .ConnectionRepository import *
|
||||
from direct.task import Task
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from panda3d.core import ConfigVariableDouble, ConfigVariableInt, ConfigVariableBool
|
||||
|
||||
ASYNC_REQUEST_DEFAULT_TIMEOUT_IN_SECONDS = 8.0
|
||||
|
@ -3,7 +3,19 @@
|
||||
from .ClientRepositoryBase import ClientRepositoryBase
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
from .MsgTypesCMU import *
|
||||
from .MsgTypesCMU import (
|
||||
CLIENT_DISCONNECT_CMU,
|
||||
CLIENT_HEARTBEAT_CMU,
|
||||
CLIENT_OBJECT_UPDATE_FIELD_TARGETED_CMU,
|
||||
CLIENT_SET_INTEREST_CMU,
|
||||
OBJECT_DELETE_CMU,
|
||||
OBJECT_DISABLE_CMU,
|
||||
OBJECT_GENERATE_CMU,
|
||||
OBJECT_SET_ZONE_CMU,
|
||||
OBJECT_UPDATE_FIELD_CMU,
|
||||
REQUEST_GENERATES_CMU,
|
||||
SET_DOID_RANGE_CMU,
|
||||
)
|
||||
from .PyDatagram import PyDatagram
|
||||
from .PyDatagramIterator import PyDatagramIterator
|
||||
from panda3d.core import UniqueIdAllocator, Notify, ClockObject
|
||||
|
@ -1,5 +1,10 @@
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from panda3d.core import (
|
||||
ClockObject,
|
||||
ConfigVariableBool,
|
||||
ConfigVariableDouble,
|
||||
Datagram,
|
||||
DatagramIterator,
|
||||
)
|
||||
from direct.task import Task
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
@ -7,11 +12,10 @@ from direct.distributed.CRDataCache import CRDataCache
|
||||
from direct.distributed.ConnectionRepository import ConnectionRepository
|
||||
from direct.showbase.PythonUtil import safeRepr, itype, makeList
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
from .MsgTypes import *
|
||||
from .MsgTypes import CLIENT_ENTER_OBJECT_REQUIRED_OTHER, MsgId2Names
|
||||
from . import CRCache
|
||||
from . import ParentMgr
|
||||
from . import RelatedObjectMgr
|
||||
from .ClockDelta import *
|
||||
import time
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from panda3d.core import DocumentSpec, Filename, HTTPClient, VirtualFileSystem, getModelPath
|
||||
from panda3d.direct import CConnectionRepository, DCPacker
|
||||
from direct.task import Task
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
|
@ -1,7 +1,6 @@
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from panda3d.core import ConfigVariableInt, GeomNode, NodePath, PerspectiveLens, Point3, VBase2
|
||||
from direct.fsm.FSM import FSM
|
||||
from direct.interval.IntervalGlobal import *
|
||||
from direct.interval.IntervalGlobal import LerpScaleInterval, Sequence
|
||||
from direct.distributed.DistributedObject import DistributedObject
|
||||
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from direct.distributed.DistributedObjectOV import DistributedObjectOV
|
||||
|
||||
class DistributedCameraOV(DistributedObjectOV):
|
||||
|
@ -1,7 +1,4 @@
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from direct.interval.IntervalGlobal import *
|
||||
from panda3d.core import ConfigVariableBool, TextNode, VBase4, Vec3
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
|
||||
from direct.distributed.DistributedNode import DistributedNode
|
||||
@ -13,7 +10,7 @@ from direct.distributed.GridParent import GridParent
|
||||
|
||||
if __debug__:
|
||||
# For grid drawing
|
||||
from direct.directtools.DirectGeometry import *
|
||||
from direct.directtools.DirectGeometry import LineNodePath
|
||||
from direct.showbase.PythonUtil import randFloat
|
||||
|
||||
from .CartesianGridBase import CartesianGridBase
|
||||
|
@ -1,6 +1,3 @@
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from direct.task import Task
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
|
@ -1,7 +1,6 @@
|
||||
"""DistributedObject module: contains the DistributedObject class"""
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from panda3d.direct import DCPacker
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from direct.distributed.DistributedObjectBase import DistributedObjectBase
|
||||
|
@ -4,8 +4,6 @@ from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from direct.distributed.DistributedObjectBase import DistributedObjectBase
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
from direct.showbase import PythonUtil
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
#from PyDatagram import PyDatagram
|
||||
#from PyDatagramIterator import PyDatagramIterator
|
||||
|
||||
|
@ -4,8 +4,6 @@ from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from direct.distributed.DistributedObjectBase import DistributedObjectBase
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
from direct.showbase import PythonUtil
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
#from PyDatagram import PyDatagram
|
||||
#from PyDatagramIterator import PyDatagramIterator
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
"""DistributedSmoothNode module: contains the DistributedSmoothNode class"""
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from .ClockDelta import *
|
||||
import math
|
||||
from panda3d.core import ClockObject, ConfigVariableBool, ConfigVariableDouble, NodePath
|
||||
from panda3d.direct import SmoothMover
|
||||
from .ClockDelta import globalClockDelta
|
||||
from . import DistributedNode
|
||||
from . import DistributedSmoothNodeBase
|
||||
from direct.task.Task import cont
|
||||
|
@ -1,6 +1,6 @@
|
||||
"""DistributedSmoothNodeBase module: contains the DistributedSmoothNodeBase class"""
|
||||
|
||||
from .ClockDelta import *
|
||||
from .ClockDelta import globalClockDelta
|
||||
from direct.task import Task
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from direct.showbase.PythonUtil import randFloat
|
||||
|
@ -7,16 +7,22 @@ zone, remove interest in that zone.
|
||||
p.s. A great deal of this code is just code moved from ClientRepository.py.
|
||||
"""
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from .MsgTypes import *
|
||||
from direct.showbase.PythonUtil import *
|
||||
from panda3d.core import ConfigVariableBool
|
||||
from .MsgTypes import CLIENT_ADD_INTEREST, CLIENT_ADD_INTEREST_MULTIPLE, CLIENT_REMOVE_INTEREST
|
||||
from direct.showbase import DirectObject
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
from .PyDatagram import PyDatagram
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
import types
|
||||
from direct.showbase.PythonUtil import report
|
||||
from direct.showbase.PythonUtil import (
|
||||
FrameDelayedCall,
|
||||
ScratchPad,
|
||||
SerialNumGen,
|
||||
report,
|
||||
serialNum,
|
||||
uniqueElements,
|
||||
uniqueName,
|
||||
)
|
||||
|
||||
class InterestState:
|
||||
StateActive = 'Active'
|
||||
|
@ -1,6 +1,4 @@
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from panda3d.core import NodePath
|
||||
|
||||
#
|
||||
# GridParent.py
|
||||
|
@ -4,10 +4,30 @@
|
||||
# of the file rather than every time we call the putArg function.
|
||||
|
||||
from panda3d.core import Datagram
|
||||
from panda3d.direct import *
|
||||
from panda3d.direct import (
|
||||
STInt8,
|
||||
STInt16,
|
||||
STInt32,
|
||||
STInt64,
|
||||
STUint8,
|
||||
STUint16,
|
||||
STUint32,
|
||||
STUint64,
|
||||
STFloat64,
|
||||
STString,
|
||||
STBlob,
|
||||
STBlob32,
|
||||
STInt16array,
|
||||
STInt32array,
|
||||
STUint16array,
|
||||
STUint32array,
|
||||
STInt8array,
|
||||
STUint8array,
|
||||
STUint32uint8array,
|
||||
)
|
||||
# Import the type numbers
|
||||
|
||||
from direct.distributed.MsgTypes import *
|
||||
from direct.distributed.MsgTypes import CONTROL_CHANNEL
|
||||
|
||||
|
||||
class PyDatagram(Datagram):
|
||||
|
@ -3,8 +3,28 @@
|
||||
# class variable FuncDict and so we can import DCSubatomicType at the top
|
||||
# of the file rather than every time we call the putArg function.
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from panda3d.core import DatagramIterator
|
||||
from panda3d.direct import (
|
||||
STInt8,
|
||||
STInt16,
|
||||
STInt32,
|
||||
STInt64,
|
||||
STUint8,
|
||||
STUint16,
|
||||
STUint32,
|
||||
STUint64,
|
||||
STFloat64,
|
||||
STString,
|
||||
STBlob,
|
||||
STBlob32,
|
||||
STInt16array,
|
||||
STInt32array,
|
||||
STUint16array,
|
||||
STUint32array,
|
||||
STInt8array,
|
||||
STUint8array,
|
||||
STUint32uint8array,
|
||||
)
|
||||
# Import the type numbers
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""SampleObject module: contains the SampleObject class"""
|
||||
|
||||
from direct.directnotify.DirectNotifyGlobal import *
|
||||
from direct.distributed.DistributedObject import *
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from direct.distributed.DistributedObject import DistributedObject
|
||||
|
||||
class SampleObject(DistributedObject):
|
||||
|
||||
|
@ -1,8 +1,38 @@
|
||||
"""ServerRepository module: contains the ServerRepository class"""
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from direct.distributed.MsgTypesCMU import *
|
||||
from panda3d.core import (
|
||||
ConfigVariableBool,
|
||||
ConfigVariableDouble,
|
||||
ConfigVariableInt,
|
||||
ConnectionWriter,
|
||||
DatagramIterator,
|
||||
Filename,
|
||||
NetAddress,
|
||||
NetDatagram,
|
||||
PointerToConnection,
|
||||
QueuedConnectionListener,
|
||||
QueuedConnectionManager,
|
||||
QueuedConnectionReader,
|
||||
TPLow,
|
||||
UniqueIdAllocator,
|
||||
VirtualFileSystem,
|
||||
getModelPath,
|
||||
)
|
||||
from panda3d.direct import DCFile
|
||||
from direct.distributed.MsgTypesCMU import (
|
||||
CLIENT_DISCONNECT_CMU,
|
||||
CLIENT_OBJECT_GENERATE_CMU,
|
||||
CLIENT_OBJECT_UPDATE_FIELD,
|
||||
CLIENT_OBJECT_UPDATE_FIELD_TARGETED_CMU,
|
||||
CLIENT_SET_INTEREST_CMU,
|
||||
OBJECT_DELETE_CMU,
|
||||
OBJECT_DISABLE_CMU,
|
||||
OBJECT_GENERATE_CMU,
|
||||
OBJECT_SET_ZONE_CMU,
|
||||
OBJECT_UPDATE_FIELD_CMU,
|
||||
REQUEST_GENERATES_CMU,
|
||||
SET_DOID_RANGE_CMU,
|
||||
)
|
||||
from direct.task import Task
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
|
@ -1,5 +1,4 @@
|
||||
from panda3d.core import *
|
||||
from direct.showbase.DirectObject import *
|
||||
from panda3d.core import ClockObject, ConfigVariableDouble, ConfigVariableInt
|
||||
from direct.task import Task
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from direct.distributed import DistributedObject
|
||||
|
@ -1,5 +1,5 @@
|
||||
from panda3d.core import *
|
||||
from direct.distributed.ClockDelta import *
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.ClockDelta import globalClockDelta
|
||||
from direct.distributed import DistributedObjectAI
|
||||
|
||||
class TimeManagerAI(DistributedObjectAI.DistributedObjectAI):
|
||||
|
@ -25,7 +25,7 @@ from panda3d.core import Camera
|
||||
from panda3d.core import OrthographicLens
|
||||
from panda3d.core import AuxBitplaneAttrib
|
||||
from panda3d.core import LightRampAttrib
|
||||
from direct.directnotify.DirectNotifyGlobal import *
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
|
||||
__all__ = ["FilterManager"]
|
||||
|
@ -6,9 +6,9 @@ in-depth explanation and an example of how to use this class.
|
||||
|
||||
__all__ = ['DirectButton']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import Mat4, MouseButton, PGButton
|
||||
from . import DirectGuiGlobals as DGG
|
||||
from .DirectFrame import *
|
||||
from .DirectFrame import DirectFrame
|
||||
|
||||
class DirectButton(DirectFrame):
|
||||
"""
|
||||
|
@ -1,5 +1,5 @@
|
||||
from direct.gui.DirectGui import *
|
||||
from panda3d.core import *
|
||||
from direct.gui.DirectGui import DGG, DirectButton
|
||||
from panda3d.core import PGButton
|
||||
|
||||
|
||||
class DirectCheckBox(DirectButton):
|
||||
|
@ -8,9 +8,9 @@ in-depth explanation and an example of how to use this class.
|
||||
|
||||
__all__ = ['DirectCheckButton']
|
||||
|
||||
from panda3d.core import *
|
||||
from .DirectButton import *
|
||||
from .DirectLabel import *
|
||||
from panda3d.core import PGFrameStyle, VBase4
|
||||
from .DirectButton import DirectButton
|
||||
from .DirectLabel import DirectLabel
|
||||
|
||||
class DirectCheckButton(DirectButton):
|
||||
"""
|
||||
|
@ -9,11 +9,11 @@ __all__ = [
|
||||
'OkCancelDialog', 'YesNoDialog', 'YesNoCancelDialog', 'RetryCancelDialog',
|
||||
]
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import NodePath, Point3, TextNode, VBase3
|
||||
from direct.showbase import ShowBaseGlobal
|
||||
from . import DirectGuiGlobals as DGG
|
||||
from .DirectFrame import *
|
||||
from .DirectButton import *
|
||||
from .DirectFrame import DirectFrame
|
||||
from .DirectButton import DirectButton
|
||||
|
||||
|
||||
def findDialog(uniqueName):
|
||||
|
@ -7,10 +7,10 @@ explanation and an example of how to use this class.
|
||||
|
||||
__all__ = ['DirectEntry']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import ConfigVariableBool, PGEntry, Point3, TextNode, Vec3
|
||||
from direct.showbase import ShowBaseGlobal
|
||||
from . import DirectGuiGlobals as DGG
|
||||
from .DirectFrame import *
|
||||
from .DirectFrame import DirectFrame
|
||||
from .OnscreenText import OnscreenText
|
||||
# import this to make sure it gets pulled into the publish
|
||||
import encodings.utf_8
|
||||
|
@ -1,10 +1,9 @@
|
||||
__all__ = ['DirectEntryScroll']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import NodePath, OmniBoundingVolume, PGVirtualFrame
|
||||
from . import DirectGuiGlobals as DGG
|
||||
from .DirectScrolledFrame import *
|
||||
from .DirectFrame import *
|
||||
from .DirectEntry import *
|
||||
from .DirectFrame import DirectFrame
|
||||
from .DirectEntry import DirectEntry
|
||||
|
||||
class DirectEntryScroll(DirectFrame):
|
||||
def __init__(self, entry, parent = None, **kw):
|
||||
|
@ -18,9 +18,9 @@ explanation and an example of how to use this class.
|
||||
|
||||
__all__ = ['DirectFrame']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import Filename, NodePath, PGItem, Texture
|
||||
from . import DirectGuiGlobals as DGG
|
||||
from .DirectGuiBase import *
|
||||
from .DirectGuiBase import DirectGuiWidget
|
||||
from .OnscreenImage import OnscreenImage
|
||||
from .OnscreenGeom import OnscreenGeom
|
||||
from .OnscreenText import OnscreenText
|
||||
|
@ -87,14 +87,21 @@ Code overview:
|
||||
__all__ = ['DirectGuiBase', 'DirectGuiWidget']
|
||||
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import (
|
||||
ConfigVariableBool,
|
||||
KeyboardButton,
|
||||
MouseWatcherRegion,
|
||||
NodePath,
|
||||
PGFrameStyle,
|
||||
PGItem,
|
||||
Point3,
|
||||
Texture,
|
||||
Vec3,
|
||||
)
|
||||
from direct.showbase import ShowBaseGlobal
|
||||
from direct.showbase.ShowBase import ShowBase
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
from . import DirectGuiGlobals as DGG
|
||||
from .OnscreenText import *
|
||||
from .OnscreenGeom import *
|
||||
from .OnscreenImage import *
|
||||
from direct.directtools.DirectUtil import ROUND_TO
|
||||
from direct.showbase import DirectObject
|
||||
from direct.task import Task
|
||||
|
@ -5,7 +5,15 @@ that can be used during widget construction
|
||||
|
||||
__all__ = []
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import (
|
||||
KeyboardButton,
|
||||
MouseButton,
|
||||
PGButton,
|
||||
PGEntry,
|
||||
PGFrameStyle,
|
||||
PGSliderBar,
|
||||
TextNode,
|
||||
)
|
||||
|
||||
defaultFont = None
|
||||
defaultFontFunc = TextNode.getDefaultFont
|
||||
|
@ -4,12 +4,13 @@ __all__ = []
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from panda3d.core import Point3
|
||||
from direct.showbase.ShowBase import ShowBase
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from . import DirectGuiGlobals
|
||||
from .DirectGui import *
|
||||
from .DirectGui import DirectButton, DirectDialog, DirectEntry, DirectFrame, YesNoDialog
|
||||
#from whrandom import *
|
||||
from random import *
|
||||
from random import random
|
||||
|
||||
base = ShowBase()
|
||||
|
||||
|
@ -6,8 +6,8 @@ explanation and an example of how to use this class.
|
||||
|
||||
__all__ = ['DirectLabel']
|
||||
|
||||
from panda3d.core import *
|
||||
from .DirectFrame import *
|
||||
from panda3d.core import PGItem
|
||||
from .DirectFrame import DirectFrame
|
||||
|
||||
class DirectLabel(DirectFrame):
|
||||
"""
|
||||
|
@ -6,12 +6,11 @@ in-depth explanation and an example of how to use this class.
|
||||
|
||||
__all__ = ['DirectOptionMenu']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import OmniBoundingVolume, TextNode, VBase3
|
||||
from direct.showbase import ShowBaseGlobal
|
||||
from . import DirectGuiGlobals as DGG
|
||||
from .DirectButton import *
|
||||
from .DirectLabel import *
|
||||
from .DirectFrame import *
|
||||
from .DirectButton import DirectButton
|
||||
from .DirectFrame import DirectFrame
|
||||
|
||||
|
||||
class DirectOptionMenu(DirectButton):
|
||||
|
@ -9,10 +9,10 @@ in-depth explanation and an example of how to use this class.
|
||||
|
||||
__all__ = ['DirectRadioButton']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import PGFrameStyle, VBase4
|
||||
from . import DirectGuiGlobals as DGG
|
||||
from .DirectButton import *
|
||||
from .DirectLabel import *
|
||||
from .DirectButton import DirectButton
|
||||
from .DirectLabel import DirectLabel
|
||||
|
||||
class DirectRadioButton(DirectButton):
|
||||
"""
|
||||
|
@ -6,10 +6,10 @@ in-depth explanation and an example of how to use this class.
|
||||
|
||||
__all__ = ['DirectScrollBar']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import PGSliderBar, Vec3
|
||||
from . import DirectGuiGlobals as DGG
|
||||
from .DirectFrame import *
|
||||
from .DirectButton import *
|
||||
from .DirectFrame import DirectFrame
|
||||
from .DirectButton import DirectButton
|
||||
|
||||
|
||||
class DirectScrollBar(DirectFrame):
|
||||
|
@ -6,10 +6,10 @@ in-depth explanation and an example of how to use this class.
|
||||
|
||||
__all__ = ['DirectScrolledFrame']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import NodePath, PGScrollFrame
|
||||
from . import DirectGuiGlobals as DGG
|
||||
from .DirectFrame import *
|
||||
from .DirectScrollBar import *
|
||||
from .DirectFrame import DirectFrame
|
||||
from .DirectScrollBar import DirectScrollBar
|
||||
|
||||
|
||||
class DirectScrolledFrame(DirectFrame):
|
||||
|
@ -6,14 +6,14 @@ in-depth explanation and an example of how to use this class.
|
||||
|
||||
__all__ = ['DirectScrolledListItem', 'DirectScrolledList']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import TextNode
|
||||
from direct.showbase import ShowBaseGlobal
|
||||
from . import DirectGuiGlobals as DGG
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.task.Task import Task
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from .DirectFrame import *
|
||||
from .DirectButton import *
|
||||
from .DirectFrame import DirectFrame
|
||||
from .DirectButton import DirectButton
|
||||
|
||||
|
||||
class DirectScrolledListItem(DirectButton):
|
||||
|
@ -6,10 +6,10 @@ in-depth explanation and an example of how to use this class.
|
||||
|
||||
__all__ = ['DirectSlider']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import PGSliderBar, Vec3
|
||||
from . import DirectGuiGlobals as DGG
|
||||
from .DirectFrame import *
|
||||
from .DirectButton import *
|
||||
from .DirectFrame import DirectFrame
|
||||
from .DirectButton import DirectButton
|
||||
from math import isnan
|
||||
|
||||
|
||||
|
@ -6,9 +6,9 @@ in-depth explanation and an example of how to use this class.
|
||||
|
||||
__all__ = ['DirectWaitBar']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import PGFrameStyle, PGWaitBar
|
||||
from . import DirectGuiGlobals as DGG
|
||||
from .DirectFrame import *
|
||||
from .DirectFrame import DirectFrame
|
||||
|
||||
|
||||
class DirectWaitBar(DirectFrame):
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
__all__ = ['OnscreenGeom']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import NodePath, VBase3
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@ this class.
|
||||
|
||||
__all__ = ['OnscreenImage']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import CardMaker, NodePath, Texture, TexturePool, VBase3
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@ this class.
|
||||
|
||||
__all__ = ['OnscreenText', 'Plain', 'ScreenTitle', 'ScreenPrompt', 'NameConfirm', 'BlackOnWhite']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import LColor, Mat4, NodePath, Point3, TextNode, TextProperties, Vec3
|
||||
from . import DirectGuiGlobals as DGG
|
||||
import warnings
|
||||
|
||||
|
@ -6,9 +6,8 @@ of this class.
|
||||
|
||||
__all__ = ['ActorInterval', 'LerpAnimInterval']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from direct.directnotify.DirectNotifyGlobal import *
|
||||
from panda3d.direct import CInterval, CLerpAnimEffectInterval
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from . import Interval
|
||||
import math
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
__all__ = ['AnimControlInterval']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from direct.directnotify.DirectNotifyGlobal import *
|
||||
from panda3d.core import AnimControl, AnimControlCollection, ConfigVariableBool
|
||||
from panda3d.direct import CInterval
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from . import Interval
|
||||
import math
|
||||
|
||||
|
@ -2,9 +2,8 @@
|
||||
|
||||
__all__ = ['FunctionInterval', 'EventInterval', 'AcceptInterval', 'IgnoreInterval', 'ParentInterval', 'WrtParentInterval', 'PosInterval', 'HprInterval', 'ScaleInterval', 'PosHprInterval', 'HprScaleInterval', 'PosHprScaleInterval', 'Func', 'Wait']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from direct.showbase.MessengerGlobal import *
|
||||
from panda3d.direct import WaitInterval
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from . import Interval
|
||||
|
||||
|
@ -2,9 +2,8 @@
|
||||
|
||||
__all__ = ['IndirectInterval']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from direct.directnotify.DirectNotifyGlobal import *
|
||||
from panda3d.direct import CInterval
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from . import Interval
|
||||
from . import LerpBlendHelpers
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
__all__ = ['Interval']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from panda3d.core import ClockObject, PStatCollector
|
||||
from panda3d.direct import CInterval
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from direct.showbase.MessengerGlobal import messenger
|
||||
|
@ -3,9 +3,8 @@ this class, ivalMgr."""
|
||||
|
||||
__all__ = ['IntervalManager', 'ivalMgr']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from direct.directnotify.DirectNotifyGlobal import *
|
||||
from panda3d.core import EventQueue
|
||||
from panda3d.direct import CIntervalManager, Dtool_BorrowThisReference
|
||||
from direct.showbase import EventManager
|
||||
import fnmatch
|
||||
|
||||
|
@ -4,11 +4,23 @@ __all__ = []
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from panda3d.core import *
|
||||
from panda3d.core import Filename, Point3, Vec3
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from direct.showbase.ShowBase import ShowBase
|
||||
from direct.actor.Actor import *
|
||||
from direct.actor.Actor import Actor
|
||||
from direct.directutil import Mopath
|
||||
from .IntervalGlobal import *
|
||||
from .ActorInterval import ActorInterval
|
||||
from .FunctionInterval import (
|
||||
AcceptInterval,
|
||||
EventInterval,
|
||||
FunctionInterval,
|
||||
IgnoreInterval,
|
||||
PosHprInterval,
|
||||
)
|
||||
from .LerpInterval import LerpPosInterval, LerpHprInterval, LerpPosHprInterval
|
||||
from .MopathInterval import MopathInterval
|
||||
from .SoundInterval import SoundInterval
|
||||
from .MetaInterval import PREVIOUS_END, PREVIOUS_START, TRACK_START, Track
|
||||
|
||||
base = ShowBase()
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
__all__ = ['getBlend']
|
||||
|
||||
from panda3d.direct import *
|
||||
from panda3d.direct import EaseInBlendType, EaseInOutBlendType, EaseOutBlendType, NoBlendType
|
||||
|
||||
|
||||
easeIn = EaseInBlendType()
|
||||
|
@ -12,9 +12,9 @@ __all__ = [
|
||||
'LerpFunctionInterval', 'LerpFunc','LerpFunctionNoStateInterval','LerpFuncNS'
|
||||
]
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from direct.directnotify.DirectNotifyGlobal import *
|
||||
from panda3d.core import LOrientationf, NodePath
|
||||
from panda3d.direct import CInterval, CLerpNodePathInterval
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from . import Interval
|
||||
from . import LerpBlendHelpers
|
||||
|
||||
|
@ -5,9 +5,9 @@ intervals either in parallel or in a specified sequential order.
|
||||
|
||||
__all__ = ['MetaInterval', 'Sequence', 'Parallel', 'ParallelEndTogether', 'Track']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from direct.directnotify.DirectNotifyGlobal import *
|
||||
from panda3d.core import PStatCollector, ostream
|
||||
from panda3d.direct import CInterval, CMetaInterval
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from .IntervalManager import ivalMgr
|
||||
from . import Interval
|
||||
from direct.task.Task import TaskManager
|
||||
|
@ -3,9 +3,7 @@
|
||||
__all__ = ['MopathInterval']
|
||||
|
||||
from . import LerpInterval
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from direct.directnotify.DirectNotifyGlobal import *
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
|
||||
# import Mopath
|
||||
|
||||
|
@ -4,8 +4,7 @@ Contains the ParticleInterval class
|
||||
|
||||
__all__ = ['ParticleInterval']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from panda3d.direct import CInterval
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from .Interval import Interval
|
||||
|
||||
|
@ -2,9 +2,8 @@
|
||||
|
||||
__all__ = ['ProjectileInterval']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from direct.directnotify.DirectNotifyGlobal import *
|
||||
from panda3d.core import CollisionParabola, LParabola, NodePath, Point3, VBase3
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from .Interval import Interval
|
||||
from direct.showbase import PythonUtil
|
||||
|
||||
|
@ -2,9 +2,8 @@
|
||||
|
||||
__all__ = ['doTest']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from .IntervalGlobal import *
|
||||
from panda3d.core import Point3
|
||||
from .ProjectileInterval import ProjectileInterval
|
||||
|
||||
|
||||
def doTest():
|
||||
|
@ -2,9 +2,8 @@
|
||||
|
||||
__all__ = ['SoundInterval']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from direct.directnotify.DirectNotifyGlobal import *
|
||||
from panda3d.direct import CInterval
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from . import Interval
|
||||
import random
|
||||
|
||||
|
@ -4,8 +4,7 @@ Contains the TestInterval class
|
||||
|
||||
__all__ = ['TestInterval']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from panda3d.direct import CInterval
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from .Interval import Interval
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
from panda3d.core import *
|
||||
from panda3d.core import Mat4
|
||||
from direct.showbase.PythonUtil import Functor
|
||||
from . import ObjectGlobals as OG
|
||||
|
||||
|
@ -1,8 +1,6 @@
|
||||
"""
|
||||
This is the GUI for the Animation Control Panel
|
||||
"""
|
||||
from direct.interval.IntervalGlobal import *
|
||||
from direct.actor.Actor import *
|
||||
from . import ObjectGlobals as OG
|
||||
|
||||
import os
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""
|
||||
Defines AnimMgr
|
||||
"""
|
||||
from .AnimMgrBase import *
|
||||
from .AnimMgrBase import AnimMgrBase
|
||||
|
||||
class AnimMgr(AnimMgrBase):
|
||||
""" Animation will create, manage, update animations in the scene """
|
||||
|
@ -5,7 +5,9 @@ Defines AnimMgrBase
|
||||
import os
|
||||
import math
|
||||
|
||||
from direct.interval.IntervalGlobal import *
|
||||
from direct.interval.ActorInterval import ActorInterval
|
||||
from direct.interval.LerpInterval import LerpFunc, LerpPosHprInterval
|
||||
from direct.interval.MetaInterval import Parallel, Sequence
|
||||
from panda3d.core import VBase3
|
||||
from . import ObjectGlobals as OG
|
||||
from . import AnimGlobals as AG
|
||||
|
@ -3,8 +3,6 @@
|
||||
"""
|
||||
import wx
|
||||
|
||||
from direct.interval.IntervalGlobal import *
|
||||
from direct.actor.Actor import *
|
||||
from . import ObjectGlobals as OG
|
||||
|
||||
|
||||
|
@ -2,12 +2,10 @@
|
||||
This is the module for curve edit
|
||||
"""
|
||||
|
||||
from panda3d.core import *
|
||||
from direct.wxwidgets.WxPandaShell import *
|
||||
from direct.showbase.DirectObject import *
|
||||
from panda3d.core import BitMask32, Mat4, NodePath
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from direct.directtools.DirectSelection import SelectionRay
|
||||
from direct.showutil.Rope import Rope
|
||||
from .ActionMgr import *
|
||||
from direct.task import Task
|
||||
|
||||
|
||||
|
@ -3,7 +3,6 @@ Defines Graph Editor
|
||||
"""
|
||||
import wx
|
||||
import math
|
||||
from .PaletteTreeCtrl import *
|
||||
from . import ObjectGlobals as OG
|
||||
from . import AnimGlobals as AG
|
||||
from wx.lib.embeddedimage import PyEmbeddedImage
|
||||
|
@ -2,7 +2,6 @@
|
||||
Defines Layer UI
|
||||
"""
|
||||
import wx
|
||||
from panda3d.core import *
|
||||
|
||||
from . import ObjectGlobals as OG
|
||||
|
||||
|
@ -5,13 +5,15 @@ LevelEditor, ObjectHandler, ObjectPalette should be rewritten
|
||||
to be game specific.
|
||||
"""
|
||||
|
||||
from .LevelEditorUI import *
|
||||
from .LevelEditorBase import *
|
||||
from .ObjectMgr import *
|
||||
from .AnimMgr import *
|
||||
from .ObjectHandler import *
|
||||
from .ObjectPalette import *
|
||||
from .ProtoPalette import *
|
||||
import os
|
||||
import wx
|
||||
from .LevelEditorUI import LevelEditorUI
|
||||
from .LevelEditorBase import LevelEditorBase
|
||||
from .ObjectMgr import ObjectMgr
|
||||
from .AnimMgr import AnimMgr
|
||||
from .ObjectHandler import ObjectHandler
|
||||
from .ObjectPalette import ObjectPalette
|
||||
from .ProtoPalette import ProtoPalette
|
||||
|
||||
class LevelEditor(LevelEditorBase):
|
||||
""" Class for Panda3D LevelEditor """
|
||||
|
@ -5,15 +5,25 @@ You should write your own LevelEditor class inheriting this.
|
||||
Refer LevelEditor.py for example.
|
||||
"""
|
||||
|
||||
from direct.showbase.DirectObject import *
|
||||
from direct.directtools.DirectUtil import *
|
||||
from direct.gui.DirectGui import *
|
||||
from panda3d.core import ClockObject
|
||||
import os
|
||||
import wx
|
||||
|
||||
from .CurveEditor import *
|
||||
from .FileMgr import *
|
||||
from .ActionMgr import *
|
||||
from .MayaConverter import *
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from direct.directtools.DirectUtil import useDirectRenderStyle
|
||||
from direct.gui.OnscreenText import OnscreenText
|
||||
from panda3d.core import BitMask32, ClockObject, Mat4, NodePath, Point3, TextNode, Vec4
|
||||
|
||||
from . import ObjectGlobals as OG
|
||||
from .CurveEditor import CurveEditor
|
||||
from .FileMgr import FileMgr
|
||||
from .ActionMgr import (
|
||||
ActionDeleteObj,
|
||||
ActionDeselectAll,
|
||||
ActionMgr,
|
||||
ActionSelectObj,
|
||||
ActionTransformObj,
|
||||
)
|
||||
from .MayaConverter import FROM_BAM_TO_MAYA, MayaConverter
|
||||
|
||||
|
||||
class LevelEditorBase(DirectObject):
|
||||
|
@ -1,4 +1,4 @@
|
||||
from .LevelEditorUIBase import *
|
||||
from .LevelEditorUIBase import LevelEditorUIBase
|
||||
|
||||
class LevelEditorUI(LevelEditorUIBase):
|
||||
""" Class for Panda3D LevelEditor """
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user