How to change simulation caches path by python in C4D ?
I have tried many function in c4d doc, but doesn’t work.
Help please ~~
Thanks !!!
How to change simulation caches path by python in C4D ?
I have tried many function in c4d doc, but doesn’t work.
Help please ~~
Thanks !!!
From Python you can read/write the cache path string from/to the parameter ID_CACHE_DIR
on TFD container objects.
Thanks.
I tried this code:
# -*- coding: utf-8 -*-
import c4d
def main():
doc = c4d.documents.GetActiveDocument()
for ob in doc.GetObjects():
if ob.GetType() == 1023131: # TurbulenceFD Container 1023131
print "Mode: None"
# print "Cache list:", ob.GetParameter(c4d.ID_CACHE_LIST, c4d.DESCFLAGS_GET_0)
print "Cache dir:", ob.GetParameter(c4d.ID_CACHE_DIR, c4d.DESCFLAGS_GET_0)
print "---------------------------------"
print "Mode: Parameter retrieved"
print "Cache list:", ob.GetParameter(c4d.ID_CACHE_LIST, c4d.DESCFLAGS_GET_PARAM_GET)
print "Cache dir:", ob.GetParameter(c4d.ID_CACHE_DIR, c4d.DESCFLAGS_GET_PARAM_GET)
print "---------------------------------"
print "Mode: Private"
# print "Cache list:", ob.GetParameter(c4d.ID_CACHE_LIST, c4d.DESCFLAGS_GET_NO_GLOBALDATA)
print "Cache dir:", ob.GetParameter(c4d.ID_CACHE_DIR, c4d.DESCFLAGS_GET_NO_GLOBALDATA)
print "---------------------------------"
print "The GeData default type will not be initialized for GetParameter() if this flag is set"
# print "Cache list:", ob.GetParameter(c4d.ID_CACHE_LIST, c4d.DESCFLAGS_GET_NO_GEDATADEFAULTVALUE)
print "Cache dir:", ob.GetParameter(c4d.ID_CACHE_DIR, c4d.DESCFLAGS_GET_NO_GEDATADEFAULTVALUE)
if __name__ == "__main__":
c4d.CallCommand(13957) # Clear Console
main()
The GeData default type will not be initialized for GetParameter() if this flag is set
Cache dir: None
T^T
Help~~
Where is my error in code.
Thanks again !
Which version of TFD are you using?
My TFD version: 1.0.1435
My C4D version: R19.068
Build 1435 does not support access to these parameters from Python yet.
Please update to the latest build 1476.
Get it, thanks for answer ~~~