Page MenuHome

Fix T46338: Can't get ReplaceMesh actuator meshes from inactive scene
AbandonedPublic

Authored by Ulysse Martin (youle) on Oct 6 2015, 2:58 AM.

Details

Summary

Fix T46338: Can't get ReplaceMesh actuator meshes from inactive scene

Hi! This commit: https://developer.blender.org/rB6c9dd174a8bc2cd9a857c96f3ddfdb398aa6f88c prevented getting meshes from inactive scene as ReplaceMesh actuator meshes.

I propose this fix to have the possibility to get meshes from inactive scenes and to have the correct material for meshes used with ReplaceMesh actuator.

I'm not sure this is the correct fix so it needs review :) Thanks!

My test file: http://www.pasteall.org/blend/38421 (Thank you for pasteall :) )

Diff Detail

Event Timeline

Forgot to test if mesh has a material...

first quick review. I have to test it yet

source/gameengine/Converter/BL_BlenderDataConversion.cpp
1070

To reduce the changes necessary it would be better:

if (blenderobj && !replacemesh)
    ma = give_current_material(blenderobj, mface->mat_nr+1);
else
    ma = mesh->mat ? mesh->mat[mface->mat_nr]:NULL;
Ulysse Martin (youle) updated this revision to Diff 5119.

@Jorge Bernal (lordloki): Hehe yes I coded it like a goat (we say this in France :) ... I don't know if it's the same thing in english). I'll try to understand why give_current_material doesn't return the good material... Thanks for review!

Ulysse Martin (youle) marked an inline comment as done.Mar 23 2019, 10:27 AM
Ulysse Martin (youle) abandoned this revision.