PCache button via maxscipt

hi,

i ´d like to enable/disable the PCache button via maxscipt, what are the script parameters?

cheers Cruzifer

ps is there a full list of krakatoa commands available?

Hi!

The User Interface of Krakatoa you see is just a MAXScript. Krakatoa the renderer itself has a relatively simple string-based property system. Other than paramblock2 plugins, it allows for arbitrary user-defined parameters to be stored in the renderer. Unfortunately, this also means that you cannot call ShowProperties() on the renderer, but you can call

FranticParticleRenderMXS.getPropNames()

to get an array of all supported string properties used by the current version of the renderer.

From there, you can say

for i in FranticParticleRenderMXS.getPropNames() where matchPattern i pattern:"*Cache*" collect i #("EnableParticleCache", "EnableLightingCache", "CacheLastFrame", "UseCacheInSlaveMode", "Partition:IncrementBox3DiskCacheNames")
So you can simply use

FranticParticles.GetProperty "EnableParticleCache" --> "false", the value as String, in case you don't know the type
FranticParticles.GetBoolProperty "EnableParticleCache" --> false, this is better as it returns the Bool value
FranticParticles.SetProperty "EnableParticleCache" "true" --> OK, you MUST set the value as String though
FranticParticles.GetBoolProperty "EnableParticleCache" --> true, the value was set correctly
Krakatoa_GUI_Main.Refresh_GUI() --> this will refresh the Main Controls UI if the Krakatoa GUI is open

Hope this helps.

Cheers,

thanks a bunch bobo :slight_smile:

cheers cruzifer

bobo, i faced a new problem:
i scripted a simple 360 cylindrical render with one camera turning 8 times and recording a seemles panorama of the scene. since the camera takes 7 renders of the same light and particle situation per frame i dont need to recalculate the light and particle cache for those renders. unfortunately the pcache and lcache option is only for scene particle rendering but not for sequences to avoid the overrinding…what can i do now?

cheers cruzifer

here is my code:

for i in animationrange.start to animationrange.end do --loop for a sequence rendering
(

newimage = bitmap (renderwidth*8) renderheight color:gray --create new image

for i = 0 to 7 do
(
vr_1 = render camera:$VR_1 outputwidth:rendwidth outputheight:rendheight vfb: false progressbar:true --render camera
FranticParticles.SetProperty “EnableParticleCache” “true”
FranticParticles.SetProperty “EnableLightingCache” “true”
pasteBitmap vr_1 newimage (box2 0 0 renderwidth renderheight) [renderwidth*i,0] --composite render in new image
in coordsys local $VR_1.rotation = angleaxis -45 [0,1,0]
display newimage
)

save newimage
close newimage
FranticParticles.SetProperty “EnableParticleCache” “false”
FranticParticles.SetProperty “EnableLightingCache” “false”
gc()
slidertime += 1
)

Try calling

FranticParticles.InvalidateParticleCache() FranticParticles.InvalidateLightingCache()
instead of setting the Caches to false.
That should force the caches to be rebuild for the first camera of each frame. Let me know if that does not work. I would have expected your code to work too since you disable the cache before rendering the first camera of the next frame. I might be missing something…

You can call

showInterface FranticParticles

to see all properties and methods available in that interface, there are some very useful things hidden in there.
See also thinkboxsoftware.com/krak-maxscript-access/

unfortunately, does not work. but i rewrote my script with the max quick render command.
thanks anyway!
cheers Cruzifer

it´s me again,
i know its offtopic but i guess that nowbody could help me faster than you bobo :wink: i need to let this script render over the network farm to hit the deadline but i didn´t find a solution…maybe you could point me in the right direction? :slight_smile:

cheers cruzifer

You did not tell what you tried and where you failed.
Were you trying to render on Deadline or something else?
How many workstation vs. network licenses of Krakatoa do you have?
You could submit the script as a Deadline Script Job in Workstation mode and launch a number of concurrent tasks which would use only one license for Max and one for Krakatoa per machine. This would ensure that all the code that works on your workstation will function exactly the same there. You could release your workstation license manually from your machine so the one on the network could use it. Assuming you have enough cores and RAM, it would be faster than running locally…

i tried to use pre/post script to execute it, but i don´t know how to read out the actual frame is rendered by the netrender to let the script render that given frame. another try was to buid a batch but once again i faced my scripting limits.
i have one workstation, two slaves (standard Bundle) and deadline in free mode running.
could you explain how to use a script as a Deadline Script Job in Workstation mode?

cheers Cruzifer

thanks a million times bobo :stuck_out_tongue:
…got it to work like you said. this saves me a lot of time!!

cheers cruzifer