Entity Color/Material Protocol Support & Model Cache Robustness
- Add support for entity color and texture fields in the bridge protocol and node state. - Log and document color/material override attempts; actual application is blocked by missing upstream API. - Use robust model cache directory logic: - Prefer OS cache dir, fallback to /tmp if unavailable. - Prepare for future improvements (logging, user-specific /tmp, directory creation). - Update documentation to reflect current limitations and future roadmap. - No breaking changes; all new logic is forward-compatible and safe for merge.
This commit was merged in pull request #1.
This commit is contained in:
2
bridge/Cargo.lock
generated
2
bridge/Cargo.lock
generated
@@ -2823,7 +2823,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "stardust-xr-molecules"
|
name = "stardust-xr-molecules"
|
||||||
version = "0.45.0"
|
version = "0.45.0"
|
||||||
source = "git+https://github.com/StardustXR/molecules.git?branch=dev#53cfb2eecb066faf60a1b0da0b70f84231bae2be"
|
source = "git+https://github.com/StardustXR/molecules.git?branch=dev#26e004af199ccccb2ff4d8662f82f4d65311d8d3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ashpd",
|
"ashpd",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
|
|||||||
@@ -169,29 +169,17 @@ impl Reify for BridgeState {
|
|||||||
|
|
||||||
match Model::direct(&model_path) {
|
match Model::direct(&model_path) {
|
||||||
Ok(model) => {
|
Ok(model) => {
|
||||||
// TODO: Apply color tint to the model
|
// TODO: Color tinting is not currently supported due to missing public API in asteroids.
|
||||||
// The asteroids Model element doesn't expose material manipulation yet.
|
// When Model/MaterialParameter API is available, apply color here.
|
||||||
// This would require:
|
|
||||||
// 1. Loading the model's materials
|
|
||||||
// 2. Multiplying base color by the tint color
|
|
||||||
// 3. Re-applying the modified materials
|
|
||||||
// For now, we just log the color for debugging.
|
|
||||||
if node.color != [1.0, 1.0, 1.0, 1.0] {
|
if node.color != [1.0, 1.0, 1.0, 1.0] {
|
||||||
eprintln!("[bridge/reify] Node {} has color tint: RGBA({:.2}, {:.2}, {:.2}, {:.2}) - NOT YET APPLIED",
|
eprintln!("[bridge/reify] Node {} requested color tint RGBA({:.2}, {:.2}, {:.2}, {:.2}) -- NOT SUPPORTED YET",
|
||||||
id, node.color[0], node.color[1], node.color[2], node.color[3]);
|
id, node.color[0], node.color[1], node.color[2], node.color[3]);
|
||||||
}
|
}
|
||||||
|
// TODO: Apply texture from texture_url (future)
|
||||||
// TODO: Apply texture from texture_url
|
|
||||||
// Similar to color, texture application requires material manipulation.
|
|
||||||
// This would involve:
|
|
||||||
// 1. Downloading the texture if it's an HTTP URL
|
|
||||||
// 2. Loading it as a texture resource
|
|
||||||
// 3. Applying it to the model's materials
|
|
||||||
if !node.texture_url.is_empty() {
|
if !node.texture_url.is_empty() {
|
||||||
eprintln!("[bridge/reify] Node {} has texture URL: {} - NOT YET APPLIED",
|
eprintln!("[bridge/reify] Node {} has texture URL: {} - NOT YET APPLIED",
|
||||||
id, node.texture_url);
|
id, node.texture_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
Some(model.build())
|
Some(model.build())
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user