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
f1e114521d
commit
efe38943b5
@ -55,7 +55,7 @@ class MopathRecorder(AppShell, PandaObject):
|
|||||||
'mopathRecorderTempCS')
|
'mopathRecorderTempCS')
|
||||||
self.transitionCS = self.recorderNodePath.attachNewNode(
|
self.transitionCS = self.recorderNodePath.attachNewNode(
|
||||||
'mopathRecorderTransitionCS')
|
'mopathRecorderTransitionCS')
|
||||||
self.playbackMarker = loader.loadModel('models/directmodels/happy')
|
self.playbackMarker = loader.loadModel('models/directmodels/smiley')
|
||||||
self.playbackMarker.reparentTo(self.recorderNodePath)
|
self.playbackMarker.reparentTo(self.recorderNodePath)
|
||||||
self.playbackNodePath = None
|
self.playbackNodePath = None
|
||||||
self.lastPlaybackNodePath = None
|
self.lastPlaybackNodePath = None
|
||||||
@ -448,28 +448,25 @@ class MopathRecorder(AppShell, PandaObject):
|
|||||||
widget.onRelease = widget.onReturnRelease = self.getPostPoints
|
widget.onRelease = widget.onReturnRelease = self.getPostPoints
|
||||||
refineFrame.pack(fill = X)
|
refineFrame.pack(fill = X)
|
||||||
|
|
||||||
offsetFrame = Frame(self.refinePage)
|
frame = Frame(refineFrame)
|
||||||
self.createButton(offsetFrame, 'Refine Page', 'Offset',
|
widget = self.createCheckbutton(
|
||||||
'Zero refine curve offset',
|
self.frame, 'Refine Page', 'Refining Path',
|
||||||
self.resetOffset, side = LEFT)
|
('On: Next record session refines current path ' +
|
||||||
self.createLabeledEntry(offsetFrame, 'Refine Page', 'X',
|
'Off: Next record session records a new path'),
|
||||||
'Refine pass X offset', width = 3, expand = 1)
|
self.toggleRefine, 0,
|
||||||
self.createLabeledEntry(offsetFrame, 'Refine Page', 'Y',
|
side = LEFT, fill = BOTH, expand = 1)
|
||||||
'Refine pass Y offset', width = 3, expand = 1)
|
widget.pack_forget()
|
||||||
self.createLabeledEntry(offsetFrame, 'Refine Page', 'Z',
|
widget.grid(row=0, column=0, sticky = NSEW)
|
||||||
'Refine pass Z offset', width = 3, expand = 1)
|
widget.configure(relief = RAISED, borderwidth = 2,
|
||||||
self.createLabeledEntry(offsetFrame, 'Refine Page', 'H',
|
anchor = CENTER, width = 10)
|
||||||
'Refine pass H offset', width = 3, expand = 1)
|
widget = self.createButton(
|
||||||
self.createLabeledEntry(offsetFrame, 'Refine Page', 'P',
|
frame, 'Refine Page', 'Start Refining',
|
||||||
'Refine pass P offset', width = 3, expand = 1)
|
'Start refining path using current refining settings',
|
||||||
self.createLabeledEntry(offsetFrame, 'Refine Page', 'R',
|
self.startRefining,
|
||||||
'Refine pass R offset', width = 3, expand = 1)
|
side = LEFT, expand = 1)
|
||||||
offsetFrame.pack(fill = X)
|
widget.pack_forget()
|
||||||
|
widget.grid(row=0, column=1, sticky = NSEW)
|
||||||
frame = Frame(self.refinePage)
|
frame.pack(expand = 1, fill = x)
|
||||||
self.createButton(frame, 'Refine Page', 'Speed',
|
|
||||||
'Reset refine speed',
|
|
||||||
self.resetRefineSpeed, side = LEFT,)
|
|
||||||
|
|
||||||
self.mainNotebook.setnaturalsize()
|
self.mainNotebook.setnaturalsize()
|
||||||
|
|
||||||
@ -516,10 +513,9 @@ class MopathRecorder(AppShell, PandaObject):
|
|||||||
self.recorderNodePath.removeNode()
|
self.recorderNodePath.removeNode()
|
||||||
|
|
||||||
def createNewPointSet(self):
|
def createNewPointSet(self):
|
||||||
self.pointSet = []
|
|
||||||
self.pointSetName = self['name'] + '-ps-' + `self.pointSetCount`
|
self.pointSetName = self['name'] + '-ps-' + `self.pointSetCount`
|
||||||
# Update dictionary
|
# Update dictionary
|
||||||
self.pointSetDict[self.pointSetName] = self.pointSet
|
self.pointSet = self.pointSetDict[self.pointSetName] = []
|
||||||
# Update combo box
|
# Update combo box
|
||||||
comboBox = self.getWidget('Mopath', 'Point Set')
|
comboBox = self.getWidget('Mopath', 'Point Set')
|
||||||
scrolledList = comboBox.component('scrolledlist')
|
scrolledList = comboBox.component('scrolledlist')
|
||||||
@ -989,8 +985,8 @@ class MopathRecorder(AppShell, PandaObject):
|
|||||||
self.createNewPointSet()
|
self.createNewPointSet()
|
||||||
for i in range(self.xyzCurveFitter.getNumSamples()):
|
for i in range(self.xyzCurveFitter.getNumSamples()):
|
||||||
time = self.xyzCurveFitter.getSampleT(i)
|
time = self.xyzCurveFitter.getSampleT(i)
|
||||||
pos = self.xyzCurveFitter.getSamplePoint(i)
|
pos = Point3(self.xyzCurveFitter.getSamplePoint(i))
|
||||||
hpr = self.hprCurveFitter.getSamplePoint(i)
|
hpr = Point3(self.hprCurveFitter.getSamplePoint(i))
|
||||||
self.pointSet.append([time, pos, hpr])
|
self.pointSet.append([time, pos, hpr])
|
||||||
# Resize curve to original duration
|
# Resize curve to original duration
|
||||||
self.setPathDurationTo(maxT)
|
self.setPathDurationTo(maxT)
|
||||||
@ -1017,8 +1013,8 @@ class MopathRecorder(AppShell, PandaObject):
|
|||||||
self.createNewPointSet()
|
self.createNewPointSet()
|
||||||
for i in range(self.xyzCurveFitter.getNumSamples()):
|
for i in range(self.xyzCurveFitter.getNumSamples()):
|
||||||
time = self.xyzCurveFitter.getSampleT(i)
|
time = self.xyzCurveFitter.getSampleT(i)
|
||||||
pos = self.xyzCurveFitter.getSamplePoint(i)
|
pos = Point3(self.xyzCurveFitter.getSamplePoint(i))
|
||||||
hpr = self.hprCurveFitter.getSamplePoint(i)
|
hpr = Point3(self.hprCurveFitter.getSamplePoint(i))
|
||||||
self.pointSet.append([time, pos, hpr])
|
self.pointSet.append([time, pos, hpr])
|
||||||
# Resize curve to original duration
|
# Resize curve to original duration
|
||||||
self.setPathDurationTo(maxT)
|
self.setPathDurationTo(maxT)
|
||||||
@ -1156,12 +1152,6 @@ class MopathRecorder(AppShell, PandaObject):
|
|||||||
self.xyzCurveFitter.addPoint(adjustedTime, pos)
|
self.xyzCurveFitter.addPoint(adjustedTime, pos)
|
||||||
self.hprCurveFitter.addPoint(adjustedTime, hpr)
|
self.hprCurveFitter.addPoint(adjustedTime, hpr)
|
||||||
|
|
||||||
def resetOffset(self):
|
|
||||||
print 'reset offset'
|
|
||||||
|
|
||||||
def resetRefineSpeed(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
## WIDGET UTILITY FUNCTIONS ##
|
## WIDGET UTILITY FUNCTIONS ##
|
||||||
def addWidget(self, widget, category, text):
|
def addWidget(self, widget, category, text):
|
||||||
self.widgetDict[category + '-' + text] = widget
|
self.widgetDict[category + '-' + text] = widget
|
||||||
|
@ -278,6 +278,7 @@ class ParticlePanel(AppShell):
|
|||||||
zSpinPage = self.factoryNotebook.add('ZSpinParticleFactory')
|
zSpinPage = self.factoryNotebook.add('ZSpinParticleFactory')
|
||||||
self.createAngleDial(zSpinPage, 'Z Spin Factory', 'Initial Angle',
|
self.createAngleDial(zSpinPage, 'Z Spin Factory', 'Initial Angle',
|
||||||
'Starting angle in degrees',
|
'Starting angle in degrees',
|
||||||
|
fRollover = 1,
|
||||||
command = self.setFactoryZSpinInitialAngle)
|
command = self.setFactoryZSpinInitialAngle)
|
||||||
self.createAngleDial(
|
self.createAngleDial(
|
||||||
zSpinPage, 'Z Spin Factory',
|
zSpinPage, 'Z Spin Factory',
|
||||||
@ -286,6 +287,7 @@ class ParticlePanel(AppShell):
|
|||||||
command = self.setFactoryZSpinInitialAngleSpread)
|
command = self.setFactoryZSpinInitialAngleSpread)
|
||||||
self.createAngleDial(zSpinPage, 'Z Spin Factory', 'Final Angle',
|
self.createAngleDial(zSpinPage, 'Z Spin Factory', 'Final Angle',
|
||||||
'Final angle in degrees',
|
'Final angle in degrees',
|
||||||
|
fRollover = 1,
|
||||||
command = self.setFactoryZSpinFinalAngle)
|
command = self.setFactoryZSpinFinalAngle)
|
||||||
self.createAngleDial(
|
self.createAngleDial(
|
||||||
zSpinPage, 'Z Spin Factory',
|
zSpinPage, 'Z Spin Factory',
|
||||||
@ -694,11 +696,13 @@ class ParticlePanel(AppShell):
|
|||||||
|
|
||||||
def createFloater(self, parent, category, text, balloonHelp,
|
def createFloater(self, parent, category, text, balloonHelp,
|
||||||
command = None, min = 0.0, resolution = None,
|
command = None, min = 0.0, resolution = None,
|
||||||
|
significantDigits = 3,
|
||||||
maxVelocity = 10.0, **kw):
|
maxVelocity = 10.0, **kw):
|
||||||
kw['text'] = text
|
kw['text'] = text
|
||||||
kw['min'] = min
|
kw['min'] = min
|
||||||
kw['maxVelocity'] = maxVelocity
|
kw['maxVelocity'] = maxVelocity
|
||||||
kw['resolution'] = resolution
|
kw['resolution'] = resolution
|
||||||
|
kw['significantDigits'] = significantDigits
|
||||||
widget = apply(Floater.Floater, (parent,), kw)
|
widget = apply(Floater.Floater, (parent,), kw)
|
||||||
# Do this after the widget so command isn't called on creation
|
# Do this after the widget so command isn't called on creation
|
||||||
widget['command'] = command
|
widget['command'] = command
|
||||||
|
Loading…
x
Reference in New Issue
Block a user