Saturday, January 24, 2015

Material IO: Update 1

Material IO has been coming along well. Basic importing is now supported and all Cycles nodes can be exported and imported although their attributes and links have not been set up yet.

I encountered several problems along the way:

  1. Some issues with the XML, I am new to XML so I didn't realize that you can't have spaces in attribute names and can't have certain symbols like < or > outside of a string. For some reason the <> where coming from the node.location part because they were vectors. So I had to convert all of them to tuples. The names just have to be changed from Material Name to Material_Name
  2. I was collecting node.type for each node and was then having to change that type into a string that could be used to create the node which gave several challenges because it could be done in several ways. I figured out though, that you can just get the node.bl_idname. Which allows you to use that string directly to create the new node on importation. 

No comments:

Post a Comment