Page MenuHome

Add metadata to exported themes
Closed, ArchivedPublicPATCH

Description

This patch adds 3 metadata fields when exporting a blender xml theme: author, name and version.
On importing this information is displayed.

This patch also includes a fix for the ExpatError on windows (discussed with Campbell). It turned out to be as simple as closing the xml file after writing to it.

Event Timeline

This patch adds a spesific check for 'Theme' in rna_xml.py which I really rather not do.

Instead we could do something like X3D...

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "http://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D version="3.0" profile="Immersive" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xsd:noNamespaceSchemaLocation="http://www.web3d.org/specifications/x3d-3.0.xsd">
<head>
<meta name="filename" content="untitled.x3d" />
<meta name="generator" content="Blender 2.60 (sub 0)" />
</head>
<Scene>
--- snip

Simplified as an example for theme.

<?xml version="1.0" encoding="UTF-8"?>
<BlendData>
<head>
<meta name="title" content="Blah Blah" />
<meta name="author" content="Blah Blah" />
<meta name="generator" content="Blender 2.60 (sub 0)" />
</head>
<Theme>
--- snip


The idea is to move the data out of 'Theme' and into a sibling XML node so our XML reading doesn't need to have hard coded values.

Then writing XML can take an optional `metadata` XML node created by xml.dom.minidom, and reading the XML each loader can get the metadata out to do what it likes and it wont effect writing the non metadata XML back into the RNA.

Campbell Barton (campbellbarton) changed the task status from Unknown Status to Unknown Status.Jan 4 2012, 4:49 AM