[Papervision3D] Getting Texture Path From Collada Class ?!
manar
manar at webdesignmaroc.com
Sun Sep 2 03:17:20 PDT 2007
hmmm , so after sleeping a bit it's getting a little less cloudy .
It seems the automatic loading of textures is done by PV3D , I just needed
to put "null" as the material ... I was using some buggy collada yesterday
and when I sorted that out , intalling the recomended plugin , I didn't try
the null argument again .
But as I said what I want is to get the texture pathes out of every material
. Looking in the Collada.as code , there are many great functions there ,
they just happen to be private ... setting getTexture to public does the
trick , I can specify the material name and it gives me the binded path .
There are some interesting functions there also , mostly the Matrix
transforms , although you can do the same with geometry.transformVertices()
I suppose and the COLLADA variable to get access to the XML .
Again I don't know if I'm doing this right or if there is another simpler
way (please tell) but anyway I can now finally get the pathes and somehow
get the materials too ... I say somehow because I can only get those through
the method : collada.materialsList() wich returns a string and then I have
to parse the whole string for the individual materials ... I do this because
if I try something like this :
private function onLoaded(e : Event) : void {
scene3d.addChild(collada);
label.text = "Initializing : Model is Loaded";
stage.addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(e:Event):void
{
collada.yaw(.4);
scene3d.renderCamera(camera);
materialsList = new MaterialsList;
materialsList = collada.getMaterialsList();
for each (var material:Object in materialsList.materialsByName)
{
label.appendText(material.toString());
}
label.appendText(" #### Material List loaded succesfully");
}
I end up with the label showing : "Initializing : Model is Loaded" . In fact
it seems anything I do after I try to access the MaterialsList Class is just
not processed . Is this a bug ? or am I doing something wrong here ?
--
View this message in context: http://www.nabble.com/Getting-Texture-Path-From-Collada-Class--%21-tf4365955.html#a12447818
Sent from the Papervision3D mailing list archive at Nabble.com.
More information about the Papervision3D
mailing list