XML to Python Dict Converter #123
AnsonSavage
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey!
It seems like in some cases (e.g., the caustics optimization tutorial), the scene needs to be defined in Python because you can't define an XML scene and then dynamically inject new items/objects (if there is a way to do this, I would love to know!)
So, given that I had generated a scene in Blender, I was looking for a way to convert the XML file to Python dict construction code. I couldn't find anything online about how to do that automatically, so I had o3-mini come up with this class (after several tries). It works for my XML file, although I'm sure with more advanced stuff, it might struggle. I thought I'd post it here in case anyone else would like to use it or if anyone else knows of a better solution.
Thanks!
Anson
Example usage:
Beta Was this translation helpful? Give feedback.
All reactions