Notifications
Clear all

[Closed] Point Cache and cache file name

Hi !

I am triing automatically apply & calculate a pointcache on all my flex modifiers.

I also want the file of each pointcache to have a different names because I have got a lot of different scenes and do not want them to erase each others.

My problem is that when i change the name of the pointcache file with the script below, the pointcache is in error when I record. “Error Record cache file”.

on BT_Calculate pressed do
(

NameScene = substituteString maxfilename “.max” “_”
PointCacheName = NameScene + CHARACTER.name + “.xml”
CHARACTER.modifiers[#Point_Cache].filename = PointCacheName

)
Do I have to use the method “new” which is in the pointcache UI ? But I do not see any reference of it in the maxscript doc.

Does anyone have an idea ?
thank you in advance.
Daniel

3 Replies

you have to specify the name of the file AND its path as a string for the filename property
also in your code you can replace:
NameScene = substituteString maxfilename “.max” “
with:
NameScene = getFilenameFile maxfilename + “

so your code would be like this:

outputPath = @"C:\point_cache\" -- this should be changed to your chosen output path
 NameScene = getFilenameFile maxfilename + "_"
  PointCacheName = outputPath + NameScene + CHARACTER.name + ".xml"
  CHARACTER.modifiers[#Point_Cache].filename = PointCacheName

Joe Gunn´s cache bar:
Tutorial / File

hope it helps.

Thanks you very much guys ! You saved me hours of nervous trial and error and error and error …