Bug #351

ref name doesn't work when loading OBJs

Added by Armin Samii over 2 years ago.

Status:NewStart date:01/26/2016
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

When loading an obj, references to a texture which includes a "name" field do not work. They are untextured.
This is fixed by either converting the .obj to a .serialized, or by removing the "name" field.

Is there a sane reason for this, or is it a bug?

To be concrete, the following does not have a texture:

<?xml version="1.0" encoding="utf-8"?>

<scene version="0.5.0">
    <bsdf type="diffuse" id="textureRef">
        <texture type="scale" id="textureDiffuse">
            <texture type="bitmap">
                <string name="filename" value="texture.jpg"/>
            </texture>
        </texture>
    </bsdf>

    <shape id="purse_MKBlush_main_mesh" type="obj">
    <string name="filename" value="mesh.obj"/>
        <ref id="textureRef" name="diffuse"/>
    </shape>
</scene>

Whereas this does:

<?xml version="1.0" encoding="utf-8"?>

<scene version="0.5.0">
    <bsdf type="diffuse" id="textureRef">
        <texture type="scale" id="textureDiffuse">
            <texture type="bitmap">
                <string name="filename" value="texture.jpg"/>
            </texture>
        </texture>
    </bsdf>

    <shape id="purse_MKBlush_main_mesh" type="obj">
    <string name="filename" value="mesh.obj"/>
        <ref id="textureRef"/>
    </shape>
</scene>

And this does as well:

<?xml version="1.0" encoding="utf-8"?>

<scene version="0.5.0">
    <bsdf type="diffuse" id="textureRef">
        <texture type="scale" id="textureDiffuse">
            <texture type="bitmap">
                <string name="filename" value="texture.jpg"/>
            </texture>
        </texture>
    </bsdf>

    <shape id="purse_MKBlush_main_mesh" type="serialized">
    <string name="filename" value="mesh.serialized"/>
        <ref id="textureRef" name="diffuse"/>
    </shape>
</scene>

Also available in: Atom PDF