Storing data during a blender session
On the blenderartists forum, CoDEmanX solved my first problem, by stating that you could misuse (static) class variables for this.Now, creating a movie loop in which coloring must be applied, can be accomplished using something like
import bpy
from radthcolormesh.colormesh import ColorMesh
bpy.conext.scene.__class__.colorMesh = ColorMesh()
def applyColor(scene) :
colMaxLimit = 150
latScaleLimit = 650
latHide = 350
latUnhide = 550
frameNumber = scene.frame_current
if frameNumber < colMaxLimit:
maxValue = 0.1*(colMaxLimit - frameNumber) + 3.5
colorMesh.colormap.max = maxValue
if latHide <= frameNumber <= latUnhide:
bpy.data.objects["Lat"].hide_render = True
else:
bpy.data.objects["Lat"].hide_render = False
if frameNumber > latScaleLimit:
scene.colorMesh.lat.setScale(-0.95*float(frameNumber - latScaleLimit)/199.0 + 199.95/199.0)
scene.colorMesh.colorMesh('Suzanne')
bpy.app.handlers.frame_change_pre.append(applyColor)
Now the data is created only once.
No comments:
Post a Comment