1
2
3 import re
4 import nuke
5 import nukescripts
6
7 -def render_panel(_list, exceptOnError = True, allowFrameServer = True):
9
10
11 -def cache_particles_panel(particleCacheNode):
12 particleCacheNode.knobs()["particle_cache_render_in_progress"].setValue(True)
13 try:
14 nuke.Undo().disable()
15 rootNode = nuke.root()
16 firstFrame = rootNode['first_frame'].getValue()
17 lastFrame = rootNode['last_frame'].getValue()
18
19 padding = int(particleCacheNode['particle_cache_padding'].getValue())
20 nuke.executeMultiple((particleCacheNode,), ([firstFrame - padding, lastFrame + padding, 1],))
21 except RuntimeError, e:
22 nuke.tprint(e)
23 if e.args[0][0:9] != "Cancelled":
24 raise
25 finally:
26 nuke.Undo().enable()
27