PDA

View Full Version : Material Name is a different name inside sceneMaterials


erilaz
03-31-2005, 01:56 AM
I've created 11 new textures from another, and renamed them accordingly:

Car01 --initial texture
Car02
Car03
Car04
Car05
Car06
Car07
Car08
Car09
Car10
Car11
Car12

This works fine, and the names appear as such in the material browser, but when I go to access them via the sceneMaterials global, the names are like this:

Car01 --initial texture
Car2
Car3
Car4
Car5
Car6
Car7
Car8
Car9
Car10
Car11
Car12

What is going on here? This is in relation to the previous post I made on diffuseMaps, but this is a new problem.

Bobo
03-31-2005, 02:25 AM
Dude, are you talking about the names of TEXTURES (as in BitmapTexture()), or MATERIALS (as in Standard()). Remember that SceneMaterials contains the TOP LEVEL materials assigned to scene nodes, not the textures assigned to their diffuse slots. Did you rename the texture maps, the top-level materials, or both?

erilaz
03-31-2005, 02:30 AM
Renamed the top-level materials. I'm accessing sceneMaterials so I can rename the texture-level names!:)

erilaz
03-31-2005, 02:38 AM
I'll detail further:

I'm accessing sceneMaterials like so:

matN = sceneMaterials[materialName]

then I'm trying to change that material's diffuseMap name like so:

matN.diffuseMap.name = newName

The issue is that sceneMaterials is showing a different top-level name than what I've assigned it (and what appears in the browser!).

Bobo
03-31-2005, 02:46 AM
I'll detail further:

I'm accessing sceneMaterials like so:

matN = sceneMaterials[materialName]

then I'm trying to change that material's diffuseMap name like so:

matN.diffuseMap.name = newName

The issue is that sceneMaterials is showing a different top-level name than what I've assigned it (and what appears in the browser!).

The sceneMaterials array does not always update correctly. You might be seeing "ghosts" of pre-renaming names, although I am not sure. Don't do that. See my other post in your other thread for the right way to deal with materials and sub-materials. You don't have to rename after the fact when you can name BEFORE you assign them...

erilaz
03-31-2005, 03:08 AM
Yup. Disregard! I've followed your instructions on the other thread. Do you know if there is a fix coming for that sceneMaterials issue? Thanks again Bobo!

I've ordered your DVD by the way! :D

CGTalk Moderation
03-31-2005, 03:08 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.