Nek / blender-xmlrpc-extension

An experimental XMLRPC bridge between Blender and the world around..
1 stars 0 forks source link

Problem with Python sets #1

Open light-matters opened 2 months ago

light-matters commented 2 months ago

Somehow, passing (and receiving) sets to blender fails, apart from the empty set?

(def url--xml-rpc "http://localhost:8000")

(defn !
  "Evaluates blender code (using xml-rpc) at the given `url`."
  ([str--code]
   (! str--code url--xml-rpc))
  ([str--code url]
   (xml-rpc/call url :eval_code str--code)))

(!  "{}") ;Works!

(!  "{1,2}") ; Fails, but doesn't throw a java exception => #necessary_evil.fault.Fault{:fault-code 1, :fault-string "<class 'TypeError'>:cannot marshal <class 'set'> objects"}

(!  "{'thing', 'thing2'}") ; also fails without java exception=> #necessary_evil.fault.Fault{:fault-code 1, :fault-string "<class 'TypeError'>:cannot marshal <class 'set'> objects"}
light-matters commented 2 months ago

I realise now that an empty set works because it's actually considered a dictionary!