mirror of
https://github.com/overte-org/overte.git
synced 2025-04-10 08:56:57 +02:00
use # instead of ? for material URL name selection
This commit is contained in:
parent
78256fb5bb
commit
a50cca006e
4 changed files with 9 additions and 5 deletions
|
@ -285,7 +285,7 @@ void ModelBaker::handleFinishedMaterialBaker() {
|
|||
QJsonArray materialMapping;
|
||||
for (auto material : _hfmModel->materials) {
|
||||
QJsonObject json;
|
||||
json["mat::" + material.name] = relativeBakedMaterialURL + "?" + material.name;
|
||||
json["mat::" + material.name] = relativeBakedMaterialURL + "#" + material.name;
|
||||
materialMapping.push_back(json);
|
||||
}
|
||||
|
||||
|
|
|
@ -121,7 +121,11 @@ void MaterialEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPo
|
|||
QString materialURL = entity->getMaterialURL();
|
||||
if (materialURL != _materialURL) {
|
||||
_materialURL = materialURL;
|
||||
if (_materialURL.contains("?")) {
|
||||
if (_materialURL.contains("#")) {
|
||||
auto split = _materialURL.split("#");
|
||||
newCurrentMaterialName = split.last().toStdString();
|
||||
} else if (_materialURL.contains("?")) {
|
||||
qDebug() << "DEPRECATED: Use # instead of ? for material URLS:" << _materialURL;
|
||||
auto split = _materialURL.split("?");
|
||||
newCurrentMaterialName = split.last().toStdString();
|
||||
}
|
||||
|
|
|
@ -976,7 +976,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
|
|||
* by setting the <code>entityHostType</code> parameter in {@link Entities.addEntity} to <code>"avatar"</code>.
|
||||
* Material entities render as non-scalable spheres if they don't have their parent set.
|
||||
* @typedef {object} Entities.EntityProperties-Material
|
||||
* @property {string} materialURL="" - URL to a {@link MaterialResource}. If you append <code>?name</code> to the URL, the
|
||||
* @property {string} materialURL="" - URL to a {@link MaterialResource}. If you append <code>#name</code> to the URL, the
|
||||
* material with that name in the {@link MaterialResource} will be applied to the entity. <br />
|
||||
* Alternatively, set the property value to <code>"materialData"</code> to use the <code>materialData</code> property
|
||||
* for the {@link MaterialResource} values.
|
||||
|
|
|
@ -1561,8 +1561,8 @@ void Model::applyMaterialMapping() {
|
|||
{
|
||||
QString url = networkMaterialResource->getURL().toString();
|
||||
bool foundMaterialName = false;
|
||||
if (url.contains("?")) {
|
||||
auto split = url.split("?");
|
||||
if (url.contains("#")) {
|
||||
auto split = url.split("#");
|
||||
std::string materialName = split.last().toStdString();
|
||||
auto networkMaterialIter = networkMaterialResource->parsedMaterials.networkMaterials.find(materialName);
|
||||
if (networkMaterialIter != networkMaterialResource->parsedMaterials.networkMaterials.end()) {
|
||||
|
|
Loading…
Reference in a new issue