On 09/01/2015 at 08:00, xxxxxxxx wrote:
Hi Conner,
I had to add a bit to your script to get it to work. I honestly don't know what problem you're having if you're not getting errors, as the following works. Mostly notably, if you run it once, you get 'jim 123' just at the end since it's empty to start, and then if you change 'jim 123' to something else, you'll get 'jim 123' after start, but then whatever you change it to after end. That proves setting and getting world plugin data functions as expected. The added "if" early on ensures that the script runs the first time, when there's no data stored, so perhaps you're getting a silent failure?
import c4d
from c4d import plugins
def main() :
data = plugins.GetWorldPluginData(1034395)
print "start"
if data:
print data.GetString(1009)
if not data:
data = c4d.BaseContainer()
versionstring = "jim 123"
data.SetString(1009,versionstring)
plugins.SetWorldPluginData(1034395,data)
print "end"
print versionstring
return
I hope that helps.
Joey Gaspe
SDK Support Engineer