thcmedia / papervision3d

Automatically exported from code.google.com/p/papervision3d
0 stars 0 forks source link

function getTexture() returns null in Collada.as #245

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Import with org/papervision3d/objects/parsers/Collada.as a texturized
collada DAE with assinged material(s), generated with 3dsmax (and probably
other apps).

2. Create an instance of a collada DAE, with null as library for materials
to load default ones:

var cowModel:Collada = new Collada("cow.dae", null);

3.

What is the expected output? What do you see instead?

The function should return "filename" from XML node - instead it fails.
COLLADA.library_materials.material.(@id == name)[0] should return an XML,
instead it returns null.
Like this mapped textures do not appear on the model.

What version of the product are you using? On what operating system?
Papervision3D_2.1.920
Linux - Ubuntu 8.10
Adobe Flex GUMBO (flex_sdk_4.0.0.10339)

Please provide any additional information below.
Variable-name conflict??
SOLUTION: change the functions argument "name" to "_name" (for example) as
follows:
    ...
    // Retrieves the filename of a material

    private function getTexture( _name:String ):String

    {

            var filename:String = null;

            var material:XML = COLLADA.library_materials.material.(@id == _name)[0];

    ...

Original issue reported on code.google.com by daniels...@gmail.com on 17 Dec 2009 at 7:25

Attachments: