其他 - 图1

问题

image.png
image.png
image.png
image.png

常用代码

  1. import c4d
  2. import redshift
  3. from os.path import join
  4. from c4d import documents
  5. from c4d import gui
  6. import json
  1. import c4d
  2. import os
  3. def main():
  4. if __name__=='__main__':
  5. main()
  6. c4d.EventAdd()

文件保存

  1. def creatJsonFile( msg,savePath1): #创建json文件
  2. if savePath1[-5:] == ".json":
  3. full_path = savePath1
  4. else:
  5. full_path = savePath1+ '.json'
  6. file = open(full_path,'w')
  7. file.write(msg)
  8. file.close()
  9. print('Done')

文件读取

  1. def creatJsonFile( msg,savePath1): #创建json文件
  2. if savePath1[-5:] == ".json":
  3. full_path = savePath1
  4. else:
  5. full_path = savePath1+ '.json'
  6. file = open(full_path,'w')
  7. file.write(msg)
  8. file.close()
  9. print('Done')

参考