Updated print params to handles new color interpolation code.

This commit is contained in:
Josh Wilson 2005-06-16 21:01:57 +00:00
parent 9621c1cca9
commit 7d4dd492ae

View File

@ -352,32 +352,29 @@ class Particles(ParticleSystem):
segIdList = eval('['+cim.getSegmentIdList().replace(' ',', ')+']') segIdList = eval('['+cim.getSegmentIdList().replace(' ',', ')+']')
for sid in segIdList: for sid in segIdList:
seg = cim.getSegment(sid) seg = cim.getSegment(sid)
t_b = seg.getTimeBegin() if( seg.isEnabled() ):
t_e = seg.getTimeEnd() t_b = seg.getTimeBegin()
fun = seg.getFunction() t_e = seg.getTimeEnd()
type = fun.getType() fun = seg.getFunction()
if type == 'ColorInterpolationFunctionConstant': typ = type(fun).__name__
fun = cim.downcastFunctionToConstant(fun) if typ == 'ColorInterpolationFunctionConstant':
c_a = fun.getColorA() c_a = fun.getColorA()
file.write(targ+'.renderer.getColorInterpolationManager().addConstant('+`t_b`+','+`t_e`+','+`c_a`+')\n') file.write(targ+'.renderer.getColorInterpolationManager().addConstant('+`t_b`+','+`t_e`+','+`c_a`+')\n')
elif type == 'ColorInterpolationFunctionLinear': elif typ == 'ColorInterpolationFunctionLinear':
fun = cim.downcastFunctionToLinear(fun) c_a = fun.getColorA()
c_a = fun.getColorA() c_b = fun.getColorB()
c_b = fun.getColorB() file.write(targ+'.renderer.getColorInterpolationManager().addLinear('+`t_b`+','+`t_e`+','+`c_a`+','+`c_b`+')\n')
file.write(targ+'.renderer.getColorInterpolationManager().addLinear('+`t_b`+','+`t_e`+','+`c_a`+','+`c_b`+')\n') elif typ == 'ColorInterpolationFunctionStepwave':
elif type == 'ColorInterpolationFunctionStepwave': c_a = fun.getColorA()
fun = cim.downcastFunctionToStepwave(fun) c_b = fun.getColorB()
c_a = fun.getColorA() w_a = fun.getWidthA()
c_b = fun.getColorB() w_b = fun.getWidthB()
w_a = fun.getWidthA() file.write(targ+'.renderer.getColorInterpolationManager().addStepwave('+`t_b`+','+`t_e`+','+`c_a`+','+`c_b`+','+`w_a`+','+`w_b`+')\n')
w_b = fun.getWidthB() elif typ == 'ColorInterpolationFunctionSinusoid':
file.write(targ+'.renderer.getColorInterpolationManager().addStepwave('+`t_b`+','+`t_e`+','+`c_a`+','+`c_b`+','+`w_a`+','+`w_b`+')\n') c_a = fun.getColorA()
elif type == 'ColorInterpolationFunctionSinusoid': c_b = fun.getColorB()
fun = cim.downcastFunctionToSinusoid(fun) per = fun.getPeriod()
c_a = fun.getColorA() file.write(targ+'.renderer.getColorInterpolationManager().addSinusoid('+`t_b`+','+`t_e`+','+`c_a`+','+`c_b`+','+`per`+')\n')
c_b = fun.getColorB()
per = fun.getPeriod()
file.write(targ+'.renderer.getColorInterpolationManager().addSinusoid('+`t_b`+','+`t_e`+','+`c_a`+','+`c_b`+','+`per`+')\n')
elif (self.rendererType == "SparkleParticleRenderer"): elif (self.rendererType == "SparkleParticleRenderer"):
file.write('# Sparkle parameters\n') file.write('# Sparkle parameters\n')
@ -444,32 +441,29 @@ class Particles(ParticleSystem):
segIdList = eval('['+cim.getSegmentIdList().replace(' ',', ')+']') segIdList = eval('['+cim.getSegmentIdList().replace(' ',', ')+']')
for sid in segIdList: for sid in segIdList:
seg = cim.getSegment(sid) seg = cim.getSegment(sid)
t_b = seg.getTimeBegin() if( seg.isEnabled() ):
t_e = seg.getTimeEnd() t_b = seg.getTimeBegin()
fun = seg.getFunction() t_e = seg.getTimeEnd()
type = fun.getType() fun = seg.getFunction()
if type == 'ColorInterpolationFunctionConstant': typ = type(fun).__name__
fun = cim.downcastFunctionToConstant(fun) if typ == 'ColorInterpolationFunctionConstant':
c_a = fun.getColorA() c_a = fun.getColorA()
file.write(targ+'.renderer.getColorInterpolationManager().addConstant('+`t_b`+','+`t_e`+','+`c_a`+')\n') file.write(targ+'.renderer.getColorInterpolationManager().addConstant('+`t_b`+','+`t_e`+','+`c_a`+')\n')
elif type == 'ColorInterpolationFunctionLinear': elif typ == 'ColorInterpolationFunctionLinear':
fun = cim.downcastFunctionToLinear(fun) c_a = fun.getColorA()
c_a = fun.getColorA() c_b = fun.getColorB()
c_b = fun.getColorB() file.write(targ+'.renderer.getColorInterpolationManager().addLinear('+`t_b`+','+`t_e`+','+`c_a`+','+`c_b`+')\n')
file.write(targ+'.renderer.getColorInterpolationManager().addLinear('+`t_b`+','+`t_e`+','+`c_a`+','+`c_b`+')\n') elif typ == 'ColorInterpolationFunctionStepwave':
elif type == 'ColorInterpolationFunctionStepwave': c_a = fun.getColorA()
fun = cim.downcastFunctionToStepwave(fun) c_b = fun.getColorB()
c_a = fun.getColorA() w_a = fun.getWidthA()
c_b = fun.getColorB() w_b = fun.getWidthB()
w_a = fun.getWidthA() file.write(targ+'.renderer.getColorInterpolationManager().addStepwave('+`t_b`+','+`t_e`+','+`c_a`+','+`c_b`+','+`w_a`+','+`w_b`+')\n')
w_b = fun.getWidthB() elif typ == 'ColorInterpolationFunctionSinusoid':
file.write(targ+'.renderer.getColorInterpolationManager().addStepwave('+`t_b`+','+`t_e`+','+`c_a`+','+`c_b`+','+`w_a`+','+`w_b`+')\n') c_a = fun.getColorA()
elif type == 'ColorInterpolationFunctionSinusoid': c_b = fun.getColorB()
fun = cim.downcastFunctionToSinusoid(fun) per = fun.getPeriod()
c_a = fun.getColorA() file.write(targ+'.renderer.getColorInterpolationManager().addSinusoid('+`t_b`+','+`t_e`+','+`c_a`+','+`c_b`+','+`per`+')\n')
c_b = fun.getColorB()
per = fun.getPeriod()
file.write(targ+'.renderer.getColorInterpolationManager().addSinusoid('+`t_b`+','+`t_e`+','+`c_a`+','+`c_b`+','+`per`+')\n')
file.write('# Emitter parameters\n') file.write('# Emitter parameters\n')
emissionType = self.emitter.getEmissionType() emissionType = self.emitter.getEmissionType()