mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
*** empty log message ***
This commit is contained in:
parent
aa9b5805b0
commit
5b5562336a
@ -34,10 +34,6 @@ class DirectSession(PandaObject):
|
|||||||
self.fControl = 0
|
self.fControl = 0
|
||||||
self.fAlt = 0
|
self.fAlt = 0
|
||||||
self.fShift = 0
|
self.fShift = 0
|
||||||
self.in2DWidget = 0
|
|
||||||
|
|
||||||
self.mouseX = 0
|
|
||||||
self.mouseY = 0
|
|
||||||
|
|
||||||
self.pos = VBase3()
|
self.pos = VBase3()
|
||||||
self.hpr = VBase3()
|
self.hpr = VBase3()
|
||||||
@ -54,8 +50,7 @@ class DirectSession(PandaObject):
|
|||||||
('deselect', self.deselect),
|
('deselect', self.deselect),
|
||||||
('deselectAll', self.deselectAll),
|
('deselectAll', self.deselectAll),
|
||||||
('highlightAll', self.selected.highlightAll),
|
('highlightAll', self.selected.highlightAll),
|
||||||
('preRemoveNodePath', self.deselect),
|
('preRemoveNodePath', self.deselect)]
|
||||||
('in2DWidget', self.in2DWidget)]
|
|
||||||
self.keyEvents = ['left', 'right', 'up', 'down',
|
self.keyEvents = ['left', 'right', 'up', 'down',
|
||||||
'escape', 'space', 'delete',
|
'escape', 'space', 'delete',
|
||||||
'shift', 'shift-up', 'alt', 'alt-up',
|
'shift', 'shift-up', 'alt', 'alt-up',
|
||||||
@ -119,9 +114,6 @@ class DirectSession(PandaObject):
|
|||||||
self.readout.setText(' ')
|
self.readout.setText(' ')
|
||||||
taskMgr.removeTasksNamed('followSelectedNodePath')
|
taskMgr.removeTasksNamed('followSelectedNodePath')
|
||||||
|
|
||||||
def in2DWidget(self):
|
|
||||||
self.in2DWidget = 1
|
|
||||||
|
|
||||||
def enable(self):
|
def enable(self):
|
||||||
# Make sure old tasks are shut down
|
# Make sure old tasks are shut down
|
||||||
self.disable()
|
self.disable()
|
||||||
@ -202,17 +194,9 @@ class DirectSession(PandaObject):
|
|||||||
|
|
||||||
def inputHandler(self, input):
|
def inputHandler(self, input):
|
||||||
# Deal with keyboard and mouse input
|
# Deal with keyboard and mouse input
|
||||||
if ((input != 'mouse1-up') & (input != 'mouse2-up') &
|
|
||||||
(input != 'mouse3-up')):
|
|
||||||
self.in2DWidget = 0
|
|
||||||
|
|
||||||
if input == 'mouse1':
|
if input == 'mouse1':
|
||||||
messenger.send('handle2DMouse1')
|
|
||||||
if not self.in2DWidget:
|
|
||||||
messenger.send('handleMouse1')
|
messenger.send('handleMouse1')
|
||||||
elif input == 'mouse1-up':
|
elif input == 'mouse1-up':
|
||||||
messenger.send('handle2DMouse1Up')
|
|
||||||
if not self.in2DWidget:
|
|
||||||
messenger.send('handleMouse1Up')
|
messenger.send('handleMouse1Up')
|
||||||
elif input == 'mouse2':
|
elif input == 'mouse2':
|
||||||
messenger.send('handleMouse2')
|
messenger.send('handleMouse2')
|
||||||
|
@ -1,77 +1,70 @@
|
|||||||
from PandaObject import *
|
from PandaObject import *
|
||||||
from PieMenu import *
|
from PieMenu import *
|
||||||
from OnscreenText import *
|
from OnscreenText import *
|
||||||
from whrandom import *
|
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
from DirectGeometry import *
|
from DirectGeometry import *
|
||||||
from SceneGraphExplorer import *
|
from SceneGraphExplorer import *
|
||||||
from tkSimpleDialog import askstring
|
from tkSimpleDialog import askstring
|
||||||
from tkFileDialog import *
|
from tkFileDialog import *
|
||||||
|
from whrandom import *
|
||||||
import Pmw
|
import Pmw
|
||||||
import Dial
|
|
||||||
import Floater
|
|
||||||
import EntryScale
|
import EntryScale
|
||||||
import VectorWidgets
|
import VectorWidgets
|
||||||
import string
|
import string
|
||||||
|
|
||||||
|
|
||||||
class LevelEditor(NodePath, PandaObject):
|
class LevelEditor(NodePath, PandaObject):
|
||||||
|
"""Class used to create a Toontown LevelEditor object"""
|
||||||
def __init__(self,direct,parent = None):
|
def __init__(self,direct,parent = None):
|
||||||
# Initialize superclass
|
# Initialize superclass
|
||||||
NodePath.__init__(self)
|
NodePath.__init__(self)
|
||||||
|
# Become the new node path
|
||||||
self.assign(hidden.attachNewNode( NamedNode('LevelEditor')))
|
self.assign(hidden.attachNewNode( NamedNode('LevelEditor')))
|
||||||
|
|
||||||
# Record handle to direct session
|
# Record handle to direct session
|
||||||
self.direct = direct
|
self.direct = direct
|
||||||
# Make sure direct is running
|
# Make sure direct is running
|
||||||
self.direct.enable()
|
self.direct.enable()
|
||||||
|
# And only the appropriate handles are showing
|
||||||
self.direct.widget.disableHandles(['x-ring', 'x-disc',
|
self.direct.widget.disableHandles(['x-ring', 'x-disc',
|
||||||
'y-ring', 'y-disc',
|
'y-ring', 'y-disc',
|
||||||
'z-post'])
|
'z-post'])
|
||||||
# Create level editor dictionaries
|
# CREATE LEVEL EDITOR DICTIONARIES
|
||||||
# This dictionary stores information about new objects added
|
# This dictionary stores information about new objects added
|
||||||
# to the level
|
# to the level
|
||||||
self.levelDictionary = {}
|
self.levelDictionary = {}
|
||||||
# This dictionary stores information about module hooks,
|
|
||||||
# grouped by level
|
|
||||||
self.hooksDictionary = {}
|
|
||||||
# This dictionary stores information about the various
|
# This dictionary stores information about the various
|
||||||
# pie menus in use
|
# pie menus in use
|
||||||
self.pieMenuDictionary = {}
|
self.pieMenuDictionary = {}
|
||||||
# This dictionary stores all the different color palettes
|
|
||||||
self.colorPaletteDictionary = {}
|
|
||||||
# This dictionary stores info about current and possible
|
# This dictionary stores info about current and possible
|
||||||
# object attributes
|
# object attributes
|
||||||
self.attributeDictionary = {}
|
self.attributeDictionary = {}
|
||||||
# This dictionary stores pleasing style combinations
|
# This dictionary stores pleasing style combinations
|
||||||
self.styleDictionary = {}
|
self.styleDictionary = {}
|
||||||
|
# This dictionary stores all the different color palettes
|
||||||
|
self.colorPaletteDictionary = {}
|
||||||
# This dictionary stores pointers to the various maps
|
# This dictionary stores pointers to the various maps
|
||||||
self.mapDictionary = {}
|
self.mapDictionary = {}
|
||||||
self.activeMap = None
|
self.activeMap = None
|
||||||
|
|
||||||
# DNAStorage instance for storing level DNA info
|
# DNAStorage instance for storing level DNA info
|
||||||
self.dnaStore = DNAStorage()
|
self.dnaStore = DNAStorage()
|
||||||
loadDNAFile(self.dnaStore, 'dna/storage.dna',
|
loadDNAFile(self.dnaStore, 'dna/storage.dna', CSDefault)
|
||||||
CSDefault)
|
|
||||||
self.dnaOutputDir = 'ToontownCentral'
|
|
||||||
self.dnaOutputFile = 'toontown_working.dna'
|
|
||||||
|
|
||||||
# Top level DNA Data Object
|
# Top level DNA Data Object
|
||||||
self.levelObjectsDNA = DNAData('LevelObjects')
|
self.groupParentDNA = self.levelObjectsDNA = DNAData('LevelObjects')
|
||||||
|
|
||||||
# Create top level node
|
# Create top level node
|
||||||
self.levelObjects = self.attachNewNode(NamedNode('LevelObjects'))
|
self.groupParent = self.levelObjects = self.attachNewNode(
|
||||||
|
NamedNode('LevelObjects'))
|
||||||
# Create a top level group
|
# Create a top level group
|
||||||
self.createTopLevelGroup()
|
#self.createTopLevelGroup()
|
||||||
|
|
||||||
# Set used to iterate over module categories
|
|
||||||
self.categorySet = []
|
|
||||||
|
|
||||||
self.selectedLevelObject = None
|
self.selectedLevelObject = None
|
||||||
self.targetDNAObject = None
|
self.targetDNAObject = None
|
||||||
self.activeMenu = None
|
self.activeMenu = None
|
||||||
|
|
||||||
|
self.dnaOutputDir = 'ToontownCentral'
|
||||||
|
self.dnaOutputFile = 'toontown_working.dna'
|
||||||
|
|
||||||
|
|
||||||
# Get a handle to the grid
|
# Get a handle to the grid
|
||||||
self.grid = self.direct.grid
|
self.grid = self.direct.grid
|
||||||
self.showGrid(0)
|
self.showGrid(0)
|
||||||
@ -125,7 +118,6 @@ class LevelEditor(NodePath, PandaObject):
|
|||||||
self.enable()
|
self.enable()
|
||||||
|
|
||||||
def initializeAttributeDictionary(self):
|
def initializeAttributeDictionary(self):
|
||||||
|
|
||||||
# Retrieve lists of available attributes from DNAStorage object
|
# Retrieve lists of available attributes from DNAStorage object
|
||||||
# Cornices
|
# Cornices
|
||||||
attributeList = self.getCatalogCodesSuffix('cornice', '_ur')
|
attributeList = self.getCatalogCodesSuffix('cornice', '_ur')
|
||||||
@ -175,9 +167,6 @@ class LevelEditor(NodePath, PandaObject):
|
|||||||
def setBuildingHeight(self, height):
|
def setBuildingHeight(self, height):
|
||||||
self.attributeDictionary['buildingHeight'] = height
|
self.attributeDictionary['buildingHeight'] = height
|
||||||
|
|
||||||
def getCategorySet(self):
|
|
||||||
return self.categorySet
|
|
||||||
|
|
||||||
def getCorniceColor(self):
|
def getCorniceColor(self):
|
||||||
return self.attributeDictionary['corniceColor']
|
return self.attributeDictionary['corniceColor']
|
||||||
|
|
||||||
@ -230,9 +219,6 @@ class LevelEditor(NodePath, PandaObject):
|
|||||||
self.groupParent = nodePath
|
self.groupParent = nodePath
|
||||||
self.groupParentDNA = parentDNA
|
self.groupParentDNA = parentDNA
|
||||||
|
|
||||||
def getHooksDictionary(self):
|
|
||||||
return self.hooksDictionary
|
|
||||||
|
|
||||||
def getLevelDictionary(self):
|
def getLevelDictionary(self):
|
||||||
return self.levelDictionary
|
return self.levelDictionary
|
||||||
|
|
||||||
@ -363,9 +349,25 @@ class LevelEditor(NodePath, PandaObject):
|
|||||||
def getWindowTextures(self):
|
def getWindowTextures(self):
|
||||||
return self.attributeDictionary['windowTextures']
|
return self.attributeDictionary['windowTextures']
|
||||||
|
|
||||||
def destroy(self):
|
def enable(self):
|
||||||
self.disable()
|
self.reparentTo(render)
|
||||||
self.removeNode()
|
self.show()
|
||||||
|
self.accept('selectedNodePath', self.selectDNARoot)
|
||||||
|
self.accept('preRemoveNodePath', self.preRemoveNodePath)
|
||||||
|
self.accept('toggleMapViz', self.toggleMapViz)
|
||||||
|
self.accept('reparentNodePath', self.reparentNodePath)
|
||||||
|
self.accept('createNewLevelGroup', self.createNewLevelGroup)
|
||||||
|
self.accept('setNodePathName', self.setNodePathName)
|
||||||
|
self.accept('manipulateObjectCleanup', self.updateSelectedPose)
|
||||||
|
self.accept('SGEFlashNodePath', self.flashNodePath)
|
||||||
|
self.accept('SGESelectNodePath', self.selectNodePath)
|
||||||
|
self.accept('SGEIsolateNodePath', self.isolateNodePath)
|
||||||
|
self.accept('SGEToggle VizNodePath', self.toggleNodePathViz)
|
||||||
|
self.accept('SGESet ParentNodePath', self.setGroupParent)
|
||||||
|
self.accept('SGEAdd GroupNodePath', self.addGroupToSelected)
|
||||||
|
self.accept('showAll', self.showAll)
|
||||||
|
self.accept('p',self.plantSelectedNodePath)
|
||||||
|
self.enableManipulation()
|
||||||
|
|
||||||
def disable(self):
|
def disable(self):
|
||||||
self.direct.deselectAll()
|
self.direct.deselectAll()
|
||||||
@ -388,6 +390,30 @@ class LevelEditor(NodePath, PandaObject):
|
|||||||
self.ignore('p')
|
self.ignore('p')
|
||||||
self.disableManipulation()
|
self.disableManipulation()
|
||||||
|
|
||||||
|
def destroy(self):
|
||||||
|
self.disable()
|
||||||
|
self.removeNode()
|
||||||
|
|
||||||
|
def resetLevel(self):
|
||||||
|
# Clear out all objects
|
||||||
|
self.direct.deselectAll()
|
||||||
|
children = self.levelObjects.getChildren()
|
||||||
|
for i in range(children.getNumPaths()):
|
||||||
|
path = children.getPath(i)
|
||||||
|
path.reparentTo(hidden)
|
||||||
|
path.remove()
|
||||||
|
|
||||||
|
# Create fresh DNA Object
|
||||||
|
self.levelObjectsDNA = DNAData('LevelObjects')
|
||||||
|
|
||||||
|
# Create new levelDictionary
|
||||||
|
self.levelDictionary = {}
|
||||||
|
|
||||||
|
# Create root node
|
||||||
|
#self.createTopLevelGroup()
|
||||||
|
|
||||||
|
self.grid.setPosHpr(0,0,0,0,0,0)
|
||||||
|
|
||||||
def disableManipulation(self):
|
def disableManipulation(self):
|
||||||
# Disable handling of mouse events
|
# Disable handling of mouse events
|
||||||
self.ignore('handleMouse3')
|
self.ignore('handleMouse3')
|
||||||
@ -462,26 +488,6 @@ class LevelEditor(NodePath, PandaObject):
|
|||||||
self.activeMap = self.mapDictionary[mapName]
|
self.activeMap = self.mapDictionary[mapName]
|
||||||
self.activeMap.reparentTo(self.levelMap)
|
self.activeMap.reparentTo(self.levelMap)
|
||||||
|
|
||||||
def enable(self):
|
|
||||||
self.reparentTo(render)
|
|
||||||
self.show()
|
|
||||||
self.accept('selectedNodePath', self.selectDNARoot)
|
|
||||||
self.accept('preRemoveNodePath', self.preRemoveNodePath)
|
|
||||||
self.accept('toggleMapViz', self.toggleMapViz)
|
|
||||||
self.accept('reparentNodePath', self.reparentNodePath)
|
|
||||||
self.accept('createNewLevelGroup', self.createNewLevelGroup)
|
|
||||||
self.accept('setNodePathName', self.setNodePathName)
|
|
||||||
self.accept('manipulateObjectCleanup', self.updateSelectedPose)
|
|
||||||
self.accept('SGEFlashNodePath', self.flashNodePath)
|
|
||||||
self.accept('SGESelectNodePath', self.selectNodePath)
|
|
||||||
self.accept('SGEIsolateNodePath', self.isolateNodePath)
|
|
||||||
self.accept('SGEToggle VizNodePath', self.toggleNodePathViz)
|
|
||||||
self.accept('SGESet ParentNodePath', self.setGroupParent)
|
|
||||||
self.accept('SGEAdd GroupNodePath', self.addGroupToSelected)
|
|
||||||
self.accept('showAll', self.showAll)
|
|
||||||
self.accept('p',self.plantSelectedNodePath)
|
|
||||||
self.enableManipulation()
|
|
||||||
|
|
||||||
def enableManipulation(self):
|
def enableManipulation(self):
|
||||||
# Enable interactive placement of a nodePath
|
# Enable interactive placement of a nodePath
|
||||||
# Turn off camera control
|
# Turn off camera control
|
||||||
@ -1594,178 +1600,6 @@ class LevelEditor(NodePath, PandaObject):
|
|||||||
self.styleDictionary = (
|
self.styleDictionary = (
|
||||||
self.attributeDictionary['toontownCentralStyleDictionary'])
|
self.attributeDictionary['toontownCentralStyleDictionary'])
|
||||||
|
|
||||||
def initializeTheBurrrghStyleDictionary(self):
|
|
||||||
dictionary = {}
|
|
||||||
styleCount = 0
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_md_blank_ur',
|
|
||||||
Vec4(0.417323, 0.15711, 0.15711, 1.0),
|
|
||||||
'window_sm_square_ur',
|
|
||||||
Vec4(0.874016, 0.654655, 0.329041, 1.0),
|
|
||||||
'cornice_marble_ur',
|
|
||||||
Vec4(0.76378, 0.572086, 0.287541, 1.0))
|
|
||||||
|
|
||||||
styleCount = styleCount + 1
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_sm_wood_ur',
|
|
||||||
Vec4(0.874016, 0.610097, 0.610097, 1.0),
|
|
||||||
'window_sm_shuttered_ur',
|
|
||||||
Vec4(0.874016, 0.548402, 0.329041, 1.0),
|
|
||||||
None,
|
|
||||||
None)
|
|
||||||
|
|
||||||
styleCount = styleCount + 1
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_sm_wood_ur',
|
|
||||||
Vec4(0.913386, 0.540868, 0.540868, 1.0),
|
|
||||||
'window_porthole_ur',
|
|
||||||
Vec4(0.0778138, 0.472441, 0.314961, 1.0),
|
|
||||||
'cornice_horizontal_ur',
|
|
||||||
Vec4(1.0, 0.501961, 0.376471, 1.0))
|
|
||||||
|
|
||||||
styleCount = styleCount + 1
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_sm_wood_ur',
|
|
||||||
Vec4(0.913386, 0.540868, 0.540868, 1.0),
|
|
||||||
'window_porthole_ur',
|
|
||||||
Vec4(0.0778138, 0.472441, 0.314961, 1.0),
|
|
||||||
'cornice_shingles_ur',
|
|
||||||
Vec4(0.732283, 0.511163, 0.511163, 1.0))
|
|
||||||
|
|
||||||
styleCount = styleCount + 1
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_md_blank_ur',
|
|
||||||
Vec4(0.384314, 0.305635, 0.187618, 1.0),
|
|
||||||
'window_sm_round_ur',
|
|
||||||
Vec4(0.779528, 0.489115, 0.293469, 1.0),
|
|
||||||
'cornice_dental_ur',
|
|
||||||
Vec4(0.574803, 0.38771, 0.340374, 1.0))
|
|
||||||
|
|
||||||
styleCount = styleCount + 1
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_bricks_dr',
|
|
||||||
Vec4(0.629921, 0.471823, 0.237147, 1.0),
|
|
||||||
'window_sm_shuttered_ur',
|
|
||||||
Vec4(1.0, 0.627451, 0.376471, 1.0),
|
|
||||||
None,
|
|
||||||
None)
|
|
||||||
|
|
||||||
styleCount = styleCount + 1
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_md_board_ur',
|
|
||||||
Vec4(0.929134, 0.153034, 0.153034, 1.0),
|
|
||||||
'window_porthole_ur',
|
|
||||||
Vec4(0.0, 0.532747, 0.317894, 1.0),
|
|
||||||
'cornice_shingles_ur',
|
|
||||||
Vec4(0.944882, 0.715146, 0.659565, 1.0))
|
|
||||||
|
|
||||||
styleCount = styleCount + 1
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_lg_brick_ur',
|
|
||||||
Vec4(0.166003, 0.440945, 0.276671, 1.0),
|
|
||||||
'window_md_curtains_ur',
|
|
||||||
Vec4(0.17258, 0.637795, 0.450208, 1.0),
|
|
||||||
None,
|
|
||||||
None)
|
|
||||||
|
|
||||||
styleCount = styleCount + 1
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_md_board_ur',
|
|
||||||
Vec4(0.929134, 0.153034, 0.153034, 1.0),
|
|
||||||
'window_porthole_ur',
|
|
||||||
Vec4(0.0, 0.532747, 0.317894, 1.0),
|
|
||||||
None,
|
|
||||||
None)
|
|
||||||
|
|
||||||
# Store this dictionary in the self.attributeDictionary
|
|
||||||
self.attributeDictionary['theBurrrghStyleDictionary'] = dictionary
|
|
||||||
|
|
||||||
def initializeMinniesMelodyLandStyleDictionary(self):
|
|
||||||
dictionary = {}
|
|
||||||
styleCount = 0
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_md_blank_ur',
|
|
||||||
Vec4(0.417323, 0.15711, 0.15711, 1.0),
|
|
||||||
'window_sm_square_ur',
|
|
||||||
Vec4(0.874016, 0.654655, 0.329041, 1.0),
|
|
||||||
'cornice_marble_ur',
|
|
||||||
Vec4(0.76378, 0.572086, 0.287541, 1.0))
|
|
||||||
|
|
||||||
styleCount = styleCount + 1
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_sm_wood_ur',
|
|
||||||
Vec4(0.874016, 0.610097, 0.610097, 1.0),
|
|
||||||
'window_sm_shuttered_ur',
|
|
||||||
Vec4(0.874016, 0.548402, 0.329041, 1.0),
|
|
||||||
None,
|
|
||||||
None)
|
|
||||||
|
|
||||||
styleCount = styleCount + 1
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_sm_wood_ur',
|
|
||||||
Vec4(0.913386, 0.540868, 0.540868, 1.0),
|
|
||||||
'window_porthole_ur',
|
|
||||||
Vec4(0.0778138, 0.472441, 0.314961, 1.0),
|
|
||||||
'cornice_horizontal_ur',
|
|
||||||
Vec4(1.0, 0.501961, 0.376471, 1.0))
|
|
||||||
|
|
||||||
styleCount = styleCount + 1
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_sm_wood_ur',
|
|
||||||
Vec4(0.913386, 0.540868, 0.540868, 1.0),
|
|
||||||
'window_porthole_ur',
|
|
||||||
Vec4(0.0778138, 0.472441, 0.314961, 1.0),
|
|
||||||
'cornice_shingles_ur',
|
|
||||||
Vec4(0.732283, 0.511163, 0.511163, 1.0))
|
|
||||||
|
|
||||||
styleCount = styleCount + 1
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_md_blank_ur',
|
|
||||||
Vec4(0.384314, 0.305635, 0.187618, 1.0),
|
|
||||||
'window_sm_round_ur',
|
|
||||||
Vec4(0.779528, 0.489115, 0.293469, 1.0),
|
|
||||||
'cornice_dental_ur',
|
|
||||||
Vec4(0.574803, 0.38771, 0.340374, 1.0))
|
|
||||||
|
|
||||||
styleCount = styleCount + 1
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_bricks_dr',
|
|
||||||
Vec4(0.629921, 0.471823, 0.237147, 1.0),
|
|
||||||
'window_sm_shuttered_ur',
|
|
||||||
Vec4(1.0, 0.627451, 0.376471, 1.0),
|
|
||||||
None,
|
|
||||||
None)
|
|
||||||
|
|
||||||
styleCount = styleCount + 1
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_md_board_ur',
|
|
||||||
Vec4(0.929134, 0.153034, 0.153034, 1.0),
|
|
||||||
'window_porthole_ur',
|
|
||||||
Vec4(0.0, 0.532747, 0.317894, 1.0),
|
|
||||||
'cornice_shingles_ur',
|
|
||||||
Vec4(0.944882, 0.715146, 0.659565, 1.0))
|
|
||||||
|
|
||||||
styleCount = styleCount + 1
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_lg_brick_ur',
|
|
||||||
Vec4(0.166003, 0.440945, 0.276671, 1.0),
|
|
||||||
'window_md_curtains_ur',
|
|
||||||
Vec4(0.17258, 0.637795, 0.450208, 1.0),
|
|
||||||
None,
|
|
||||||
None)
|
|
||||||
|
|
||||||
styleCount = styleCount + 1
|
|
||||||
self.addStyle(dictionary, styleCount,
|
|
||||||
'wall_md_board_ur',
|
|
||||||
Vec4(0.929134, 0.153034, 0.153034, 1.0),
|
|
||||||
'window_porthole_ur',
|
|
||||||
Vec4(0.0, 0.532747, 0.317894, 1.0),
|
|
||||||
None,
|
|
||||||
None)
|
|
||||||
|
|
||||||
# Store this dictionary in the self.attributeDictionary
|
|
||||||
self.attributeDictionary['minniesMelodyLandStyleDictionary'] = dictionary
|
|
||||||
|
|
||||||
def addDNAGroup(self,dnaGroup):
|
def addDNAGroup(self,dnaGroup):
|
||||||
# Add hook to allow placement of a new dna Group of this type
|
# Add hook to allow placement of a new dna Group of this type
|
||||||
# by simply hitting the space bar
|
# by simply hitting the space bar
|
||||||
@ -2294,8 +2128,7 @@ class LevelEditor(NodePath, PandaObject):
|
|||||||
# Reset DNA VIS Groups
|
# Reset DNA VIS Groups
|
||||||
self.dnaStore.resetDNAVisGroups()
|
self.dnaStore.resetDNAVisGroups()
|
||||||
# Now load in new file
|
# Now load in new file
|
||||||
self.groupParent = loadDNAFile(self.dnaStore, filename,
|
self.groupParent = loadDNAFile(self.dnaStore, filename, CSDefault)
|
||||||
CSDefault)
|
|
||||||
# Make sure the topmost level object gets put under level objects dna
|
# Make sure the topmost level object gets put under level objects dna
|
||||||
self.groupParentDNA = self.dnaStore.findDNAGroup(
|
self.groupParentDNA = self.dnaStore.findDNAGroup(
|
||||||
self.groupParent.getBottomArc())
|
self.groupParent.getBottomArc())
|
||||||
@ -2935,26 +2768,6 @@ class LevelEditor(NodePath, PandaObject):
|
|||||||
# Update props placement to reflect current mouse position
|
# Update props placement to reflect current mouse position
|
||||||
dnaGroup.setPos(self.direct.selected.last.getPos())
|
dnaGroup.setPos(self.direct.selected.last.getPos())
|
||||||
|
|
||||||
def resetLevel(self):
|
|
||||||
# Clear out all objects
|
|
||||||
self.direct.deselectAll()
|
|
||||||
children = self.levelObjects.getChildren()
|
|
||||||
for i in range(children.getNumPaths()):
|
|
||||||
path = children.getPath(i)
|
|
||||||
path.reparentTo(hidden)
|
|
||||||
path.remove()
|
|
||||||
|
|
||||||
# Create fresh DNA Object
|
|
||||||
self.levelObjectsDNA = DNAData('LevelObjects')
|
|
||||||
|
|
||||||
# Create new levelDictionary
|
|
||||||
self.levelDictionary = {}
|
|
||||||
|
|
||||||
# Create root node
|
|
||||||
self.createTopLevelGroup()
|
|
||||||
|
|
||||||
self.grid.setPosHpr(0,0,0,0,0,0)
|
|
||||||
|
|
||||||
def selectNodePath(self, aNodePath):
|
def selectNodePath(self, aNodePath):
|
||||||
# Select new node path
|
# Select new node path
|
||||||
self.direct.select(aNodePath)
|
self.direct.select(aNodePath)
|
||||||
@ -3322,8 +3135,6 @@ class LevelEditorPanel(Pmw.MegaToplevel):
|
|||||||
self.levelEditor.addLandmark(self.landmarkType)
|
self.levelEditor.addLandmark(self.landmarkType)
|
||||||
|
|
||||||
def setPropType(self,name):
|
def setPropType(self,name):
|
||||||
import pdb
|
|
||||||
pdb.set_trace()
|
|
||||||
self.propType = 'prop_' + name
|
self.propType = 'prop_' + name
|
||||||
|
|
||||||
def addProp(self):
|
def addProp(self):
|
||||||
@ -3360,7 +3171,9 @@ class LevelEditorPanel(Pmw.MegaToplevel):
|
|||||||
if ((objClass.eq(DNAWall.getClassType())) |
|
if ((objClass.eq(DNAWall.getClassType())) |
|
||||||
(objClass.eq(DNAWindows.getClassType())) |
|
(objClass.eq(DNAWindows.getClassType())) |
|
||||||
(objClass.eq(DNADoor.getClassType())) |
|
(objClass.eq(DNADoor.getClassType())) |
|
||||||
(objClass.eq(DNACornice.getClassType()))):
|
(objClass.eq(DNACornice.getClassType())) |
|
||||||
|
(objClass.eq(DNAProp.getClassType()))
|
||||||
|
):
|
||||||
self.levelEditor.updateObjColor(
|
self.levelEditor.updateObjColor(
|
||||||
self.levelEditor.targetDNAObject,
|
self.levelEditor.targetDNAObject,
|
||||||
VBase4((color[0]/255.0),
|
VBase4((color[0]/255.0),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user