Hi
Im making a tiny plugin that will grab an environment variable from the os and set it as a texture path in the preferences Files -> Paths -> File Assets -> Paths
The plugin prints that the path has been set but the path is not listed in prefs.
import c4d
import os
def PluginMessage(id, data):
if id == c4d.C4DPL_PROGRAM_STARTED:
# path = os.environ['RC_TEXTURE_PATHS']
path = "S:/_3D_Central/Maxon/tex"
print 'The path to be set {}'.format(path)
print 'Existing paths {}'.format(c4d.GetGlobalTexturePaths())
c4d.SetGlobalTexturePaths([[path, True]])
print 'New paths {}'.format(c4d.GetGlobalTexturePaths())
c4d.EventAdd()
When i run the code in a script in the editor, it works and the paths shows in the list in prefs
import c4d
import os
def main():
#path = os.environ['RC_TEXTURE_PATHS']
path = "S:/_3D_Central/Maxon/tex"
print 'The path to be set {}'.format(path)
print 'Existing paths {}'.format(c4d.GetGlobalTexturePaths())
c4d.SetGlobalTexturePaths([[path, True]])
print 'New paths {}'.format(c4d.GetGlobalTexturePaths())
if __name__=='__main__':
main()
``` Any help appreciated
Regards
Bonsak