Page 1 of 1

[REQ] Include directive

Posted: Sat Feb 10, 2007 6:02 am
by Deus
I want

<include>myfile.xml</include>

It should work as if the file was pasted into the location of the include directive

I did this myself in a couple of xml languages/projects. You need some kind of stack of old xml contexts and just make a new context with the new file.

Its perfect for many things. Got a standard camera angle? Just make a file and include it. Wanna make all those SWEET default primitives once and for all? Just include the mesh

Code: Select all

       <include>coolmesh.xml</include>

	<model>
		<pos>0 0 0</pos>
		<scale>1.0</scale>
		<mesh_name>coolmesh</mesh_name>>
	</model>
For materials the benefit is obvious

This would be even more powerful with a concept of "current setting" or a stackbased context that would allow constructions like this

Code: Select all

       <include>mysweetmaterial.xml</include>
       <material>mysweetmaterial</material>
       <include>coolmesh.xml</include>

	<model>
		<pos>0 0 0</pos>
		<scale>1.0</scale>
		<mesh_name>coolmesh</mesh_name>>
	</model>
Whatcha think?

Posted: Sat Feb 10, 2007 6:08 am
by manitwo
i think this would be really great.
particularly with regard to arneoog's upcoming material database.

Posted: Sat Feb 10, 2007 6:21 am
by arneoog
That is possibe now, pretty much.. :)
Don't remember the code.. and I can't find a file where I used it.. :?

Posted: Sat Feb 10, 2007 6:59 am
by ryjo
This works since a while back:
<include>
<pathname>my-mesh.xml</pathname>
</include>
<include>
<pathname>my-materials.xml</pathname>
</include>
.. etc ...
/ryjo

Posted: Sat Feb 10, 2007 7:00 am
by CTZn

Code: Select all

<include> 
	<pathname>yourexternalfile.xml</pathname> 
</include> 

Your external file will have to be in the form of 

<scenedata> 
... 
.. 
... 
</scenedata>
reported by u3dreal

Posted: Sat Feb 10, 2007 7:41 am
by Deus
Thats cool! Thx :)

Question. Why is Onos XML always so talky?

<include file="bla bla"/> would work.. Many many tags there

Posted: Sat Feb 10, 2007 2:15 pm
by CTZn
Hehe... I agree with you Deus, I'm refraining myself to post a request for short names for quite some days now, like <scs> instead of <scattering_coefficient_spectrum>. Would be great if Indigo could parse both of them (Maya can use 3 differents levels of concatenation for attributes, short names (ty), long names (translatey) and nice names (Translate Y), amongst them the 2 formers can be used in the same script).