obj2mesh and materials

I can't seem to get obj2mesh to recognize
materials. From the man page it seems as though
it should. It says:

"Any RADIANCE material descriptions included via one
or more -a options will be compiled and stored in the mesh
as well."

It doesn't specify the format of the -a material descriptions. Is it a rad
file with normal material defintions in it? I tried that and it didn't seem
to work.

Here's the output I get from obj2mesh on a .obj file
with a dozen materials. It seems as though it doesn't
recognize them.

Mesh statistics:
    0 materials
    16 patches (0.08 MBytes)
    3879 vertices (0.0% w/ normals, 0.0% w/ uv)
    7742 triangles (78.5% local, 20.6% joiner)
    8289 leaves in octree (34.3% empty, 6.84 avg. set size)

Are there any examples on how to do this?

- Bob

I figured out the problem...I put the "-a <materialfile>" option
after the input .obj file rather than before it. It didn't complain, and I didn't
notice.

I switched them around and it works. Sorry for the false alarm.

One other question. Is there a way to override the values
of materials on individual groups in meshes? I'd like to override
them individually from the outside so separate instances can have
different attributes. I don't want to have to create new meshes just
to change some materials on groups.

bob coyne wrote:

···

I can't seem to get obj2mesh to recognize
materials. From the man page it seems as though
it should. It says:

"Any RADIANCE material descriptions included via one
or more -a options will be compiled and stored in the mesh
as well."

It doesn't specify the format of the -a material descriptions. Is it a rad
file with normal material defintions in it? I tried that and it didn't seem
to work.
Here's the output I get from obj2mesh on a .obj file
with a dozen materials. It seems as though it doesn't
recognize them.
Mesh statistics:
   0 materials
   16 patches (0.08 MBytes)
   3879 vertices (0.0% w/ normals, 0.0% w/ uv)
   7742 triangles (78.5% local, 20.6% joiner)
   8289 leaves in octree (34.3% empty, 6.84 avg. set size)

Are there any examples on how to do this?

- Bob

Hi Bob,

From: bob coyne <[email protected]>
Date: Sun Jul 13, 2003 9:24:36 PM US/Pacific
To: [email protected]

I figured out the problem...I put the "-a <materialfile>" option
after the input .obj file rather than before it. It didn't complain, and I didn't
notice.

I switched them around and it works. Sorry for the false alarm.

This is really a bug, which I've now fixed. You should generally expect Radiance programs to check the command-line arguments for gross errors, but it doesn't really do so consistently.

One other question. Is there a way to override the values
of materials on individual groups in meshes? I'd like to override
them individually from the outside so separate instances can have
different attributes. I don't want to have to create new meshes just
to change some materials on groups.

Just like octree instances, the only way to substitute materials is wholesale. You can't control individual groups that have been compiled into a mesh; you can only replace the mesh materials with one material that covers all objects in that mesh, and you do this by specifying a material modifier to the "mesh" primitive (rather than using "void"). If you want to control materials in mesh groups, which I agree is a perfectly reasonable thing to want to do, you must break your groups into individual .OBJ files and convert them one by one with obj2mesh, reassembling them with an appropriate set of "mesh" primitives, whose materials you may then control.

-Greg