Replace Mesh doesn't replace material

Hi,

I have two sword meshes. I’m using GLSL. I want to replace one by another. I use the replace mesh actuator. It’s the same sword with another texture and material, another object and mesh name.
I assign it to a key, when I press the key the sword is the same. If I move some verticles from the 2nd sword, the sword to replace shows those changes after hitting the key, but the texture remains the same.

I think the Apricot team will have to fix this, so games can ave multiple weapons, unless there’s already a workaround for this.
If there is, please say it.

I already tried linking the material to the mesh… It didn’t work.
It actually works when I disable GLSL but I need GLSL! (Without GLSL it uses the UV Texture)
If I use TexFace it doesn’t work. If I delete the color texture it comes un-textured.

(I’m not gonna use visible and invisible objects, because the game will need lots of weapons)

Thanks in advance.

Does anyone know?

3 days have passed.

Sorry, can’t help you there mate

When you use replace mesh, it only replaces the mesh data. It’s the same object. The mesh is the physical appearance of the object. Using replace mesh, you don’t replace the material or the bounds, or the logic bricks or stuff. Just the Mesh.

I seem to remember replace mesh switching the associated UV as well. @ B3D00 can you use end object/ add object to switch your weapons? (though that is a pain, replace mesh used to be a very easy way to change up your game characters)

Thanks,
It would be great if there would be a new actuator or replace mesh would replace materials in the future. Is there any way to add this to a todo/wish list for future Blender versions?

It does work alright, you just have to set a different material index for your second mesh.

In the APRICOT release, GLSL enabled, it doesn’t work.

it did for me,wait and i’ll try to upload a .blend

hmmm,here it is. just press space and the blue cube should be replaced by the grey sphere. hope i got it right with packing the texture.

ps. my build isn’t recent, but it’s an apricot build with glsl turned on.

Attachments

replace_mesh.blend (317 KB)

It’s not working… :frowning:
Maybe it’s because of my Apricot build version

yeah,might be, I’m not really sure which revision I’m working on, but, I’ve tried the file at my brother’s comp and it works too. his version is rev15606, which one’s yours?

It replaces the sphere, but the color keeps being the same as the cube, and it’s not gray, neither on the game nor in the 3d view. I tried on 2 versions, I don’t remember the older but the newer one’s 16145

I’ve just downloaded 15977, which is the most recent one I’ve found for linux, and it doesn’t work either. so, it may’ve got screwed in newer builds, dunno when exactly.

I’ve uploaded a quick video with it working on an apricot build with glsl, but I suppose it’s pretty much pointless now…( nevermind the colours, they always end up inversed when I try to encode a blender’s AVI raw file with avidemux).

sorry for wasting your time.

report it as a bug?

this is weird, I’ve downloaded 16145 for windows and it does work.here’s a video:

http://vimeo.com/1571502

and here’s the build I’ve used:

What graphics card do you have? If you don’t know, go to the start menu, click on run, type dxdiag, if nothing appears LOGICALLY you can’t run GLSL.
Now, go to Display, tell me what does it say in “Chip type” and who’s the manufacturer.
I’d gotta go. 2AM
http://i280.photobucket.com/albums/kk175/B3D00/screen.jpg

windows box has a nvidia geforce 8500 gt --> 16145 worked fine,15606 too.

linux laptop has a nvidia geforce go 7300 -->15977 doesn’t work, it worked alright with older build though.

I’ve been using apricot builds since they put realtime shadows and texture splatting on them.So please, don’t assume I’ve spent two months thinking i was using glsl shaders while not doing it. I do know they work in my computer.

I can record another video if you need more proof.:stuck_out_tongue:

Edit: I’ve just seen your screenshot (weird it didn’t load before) and noticed you’re blender window says it’s 2.47, mine’s 2.46.

Edit2: can you give me a link to the build you’re using?

http://www.graphicall.org/builds/builds/showbuild.php?action=show&id=654,
the same you’re using