Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ObjectMgrBase Class Reference
Inheritance diagram for ObjectMgrBase:

## Public Member Functions
| __init__ (self, editor)
| addNewCurve (self, curveInfo, degree, uid=None, parent=None, fSelectObject=True, nodePath=None)
| addNewCurveFromFile (self, curveInfo, degree, uid=None, parent=None, fSelectObject=True, nodePath=None)
| addNewObject (self, typeName, uid=None, model=None, parent=None, anim=None, fSelectObject=True, nodePath=None, nameStr=None)
| deselectAll (self)
| duplicateChild (self, nodePath, parent)
| duplicateObject (self, nodePath, parent=None)
| duplicateSelected (self)
| findActors (self, parent)
| findNodes (self, parent)
| findObjectById (self, uid)
| findObjectByNodePath (self, nodePath)
| findObjectByNodePathBelow (self, nodePath)
| findObjectsByTypeName (self, typeName)
| flatten (self, newobjModel, model, objDef, uid)
| genUniqueId (self)
| getPostSaveData (self)
| getPreSaveData (self)
| getSaveData (self)
| makeSelectedLive (self)
| onEnterObjectPropUI (self, event)
| onLeaveObjectPropUI (self, event)
| removeObjectById (self, uid)
| removeObjectByNodePath (self, nodePath)
| replaceObjectWithTypeName (self, obj, typeName)
| reset (self)
| selectObject (self, nodePath, fLEPane=0)
| selectObjectCB (self, obj, fLEPane)
| setObjectTransform (self, uid, xformMat)
| spawnUpdateObjectUITask (self)
| traverse (self, parent, parentId=None)
| updateCurve (self, val, obj)
| updateObjectAnim (self, anim, obj, fSelectObject=True)
| updateObjectAnimFromUI (self, event, obj)
| updateObjectColor (self, r, g, b, a, np=None)
| updateObjectModel (self, model, obj, fSelectObject=True)
| updateObjectModelFromUI (self, event, obj)
| updateObjectProperties (self, nodePath, propValues)
| updateObjectProperty (self, event, obj, propName)
| updateObjectPropertyUI (self, obj)
| updateObjectPropValue (self, obj, propName, val, fSelectObject=False, fUndo=True)
| updateObjectTransform (self, event)
| updateObjectUITask (self, state)

## Public Attributes
list | Actor = []
| currLiveNP = None
| currNodePath = None
| editor = editor
str | lastUid = ''
int | lastUidMod = self.lastUidMod + 1
int | lastUidMode = 0
list | Nodes = []
dict | npIndex = {}
| objDegree = obj[OG.OBJ_PROP]['Degree']
dict | objects = {}
dict | objectsLastXform = {}
list | saveData = []

## Detailed Description

     ObjectMgr will create, manage, update objects in the scene

## Constructor & Destructor Documentation

## ◆ __init__()

__init__ | ( |  | self,
|  |  | editor )

## Member Function Documentation

## ◆ addNewCurve()

addNewCurve | ( |  | self,
|  |  | curveInfo,
|  |  | degree,
|  |  | uid = None,
|  |  | parent = None,
|  |  | fSelectObject = True,
|  |  | nodePath = None )

     function to add new curve to the scene

## ◆ addNewCurveFromFile()

addNewCurveFromFile | ( |  | self,
|  |  | curveInfo,
|  |  | degree,
|  |  | uid = None,
|  |  | parent = None,
|  |  | fSelectObject = True,
|  |  | nodePath = None )

     function to add new curve to the scene from file

## ◆ addNewObject()

addNewObject | ( |  | self,
|  |  | typeName,
|  |  | uid = None,
|  |  | model = None,
|  |  | parent = None,
|  |  | anim = None,
|  |  | fSelectObject = True,
|  |  | nodePath = None,
|  |  | nameStr = None )

     function to add new obj to the scene

## ◆ deselectAll()

deselectAll | ( |  | self | ) |

## ◆ duplicateChild()

duplicateChild | ( |  | self,
|  |  | nodePath,
|  |  | parent )

## ◆ duplicateObject()

duplicateObject | ( |  | self,
|  |  | nodePath,
|  |  | parent = None )

## ◆ duplicateSelected()

duplicateSelected | ( |  | self | ) |

## ◆ findActors()

findActors | ( |  | self,
|  |  | parent )

## ◆ findNodes()

findNodes | ( |  | self,
|  |  | parent )

## ◆ findObjectById()

findObjectById | ( |  | self,
|  |  | uid )

## ◆ findObjectByNodePath()

findObjectByNodePath | ( |  | self,
|  |  | nodePath )

## ◆ findObjectByNodePathBelow()

findObjectByNodePathBelow | ( |  | self,
|  |  | nodePath )

## ◆ findObjectsByTypeName()

findObjectsByTypeName | ( |  | self,
|  |  | typeName )

## ◆ flatten()

flatten | ( |  | self,
|  |  | newobjModel,
|  |  | model,
|  |  | objDef,
|  |  | uid )

## ◆ genUniqueId()

genUniqueId | ( |  | self | ) |

## ◆ getPostSaveData()

getPostSaveData | ( |  | self | ) |

    if there are additional data to be saved after main data
    you can override this function to populate data

## ◆ getPreSaveData()

getPreSaveData | ( |  | self | ) |

    if there are additional data to be saved before main data
    you can override this function to populate data

## ◆ getSaveData()

getSaveData | ( |  | self | ) |

## ◆ makeSelectedLive()

makeSelectedLive | ( |  | self | ) |

## ◆ onEnterObjectPropUI()

onEnterObjectPropUI | ( |  | self,
|  |  | event )

## ◆ onLeaveObjectPropUI()

onLeaveObjectPropUI | ( |  | self,
|  |  | event )

## ◆ removeObjectById()

removeObjectById | ( |  | self,
|  |  | uid )

## ◆ removeObjectByNodePath()

removeObjectByNodePath | ( |  | self,
|  |  | nodePath )

## ◆ replaceObjectWithTypeName()

replaceObjectWithTypeName | ( |  | self,
|  |  | obj,
|  |  | typeName )

## ◆ reset()

reset | ( |  | self | ) |

## ◆ selectObject()

selectObject | ( |  | self,
|  |  | nodePath,
|  |  | fLEPane = 0 )

## ◆ selectObjectCB()

selectObjectCB | ( |  | self,
|  |  | obj,
|  |  | fLEPane )

## ◆ setObjectTransform()

setObjectTransform | ( |  | self,
|  |  | uid,
|  |  | xformMat )

## ◆ spawnUpdateObjectUITask()

spawnUpdateObjectUITask | ( |  | self | ) |

## ◆ traverse()

traverse | ( |  | self,
|  |  | parent,
|  |  | parentId = None )

    Trasverse scene graph to gather data for saving

## ◆ updateCurve()

updateCurve | ( |  | self,
|  |  | val,
|  |  | obj )

## ◆ updateObjectAnim()

updateObjectAnim | ( |  | self,
|  |  | anim,
|  |  | obj,
|  |  | fSelectObject = True )

     replace object's anim

## ◆ updateObjectAnimFromUI()

updateObjectAnimFromUI | ( |  | self,
|  |  | event,
|  |  | obj )

     replace object's anim with one selected from UI

## ◆ updateObjectColor()

updateObjectColor | ( |  | self,
|  |  | r,
|  |  | g,
|  |  | b,
|  |  | a,
|  |  | np = None )

## ◆ updateObjectModel()

updateObjectModel | ( |  | self,
|  |  | model,
|  |  | obj,
|  |  | fSelectObject = True )

     replace object's model

## ◆ updateObjectModelFromUI()

updateObjectModelFromUI | ( |  | self,
|  |  | event,
|  |  | obj )

     replace object's model with one selected from UI

## ◆ updateObjectProperties()

updateObjectProperties | ( |  | self,
|  |  | nodePath,
|  |  | propValues )

    When a saved level is loaded,
    update an object's properties
    And call update function if defined.

## ◆ updateObjectProperty()

updateObjectProperty | ( |  | self,
|  |  | event,
|  |  | obj,
|  |  | propName )

    When an obj's property is updated in UI,
    this will update it's value in data structure.
    And call update function if defined.

## ◆ updateObjectPropertyUI()

updateObjectPropertyUI | ( |  | self,
|  |  | obj )

## ◆ updateObjectPropValue()

updateObjectPropValue | ( |  | self,
|  |  | obj,
|  |  | propName,
|  |  | val,
|  |  | fSelectObject = False,
|  |  | fUndo = True )

    Update object property value and
    call update function if defined.

## ◆ updateObjectTransform()

updateObjectTransform | ( |  | self,
|  |  | event )

## ◆ updateObjectUITask()

updateObjectUITask | ( |  | self,
|  |  | state )

## Member Data Documentation

## ◆ Actor

Actor = []

## ◆ currLiveNP

currLiveNP = None

## ◆ currNodePath

currNodePath = None

## ◆ editor

editor = editor

## ◆ lastUid

str lastUid = ''

## ◆ lastUidMod

int lastUidMod = self.lastUidMod + 1

## ◆ lastUidMode

int lastUidMode = 0

## ◆ Nodes

Nodes = []

## ◆ npIndex

dict npIndex = {}

## ◆ objDegree

objDegree = obj[OG.OBJ_PROP]['Degree']

## ◆ objects

dict objects = {}

## ◆ objectsLastXform

dict objectsLastXform = {}

## ◆ saveData

list saveData = []