Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

A 3D part asked for again by id answers its own box on the frame. The game inspector re-reads the picked element on every frame (stage.inspect), and for a 3D part that answered the holder element's box, which has none of its own: the outline a click drew on a mesh was gone a frame later, so a 3D object looked unselectable while page elements kept their outline. Live::element now places the part by its key (raea-sys-frame locate) and says it is a part. Seen in raea.app 0.1.0-dev.1109.33: three meshes in a paused game keep their outline as frames step.

shinyobjectz0614e4b95041
diff --git a/docs/preview.feature b/docs/preview.feature
index 89ab6491..d6465c3e 100644
--- a/docs/preview.feature
+++ b/docs/preview.feature
@@ -115,6 +115,10 @@ Feature: Preview: anything in a project opens at once, in its space, with its pr
# (.raea-view-NAME.tsx) is rewritten at one path and the bundle cache's folder walk passes dot files over, so a
# wrapper naming a new light level got the bundle naming the old one (a level since dropped: "doesn't exist").
# A dot-named edit is now part of its bundle's key.
+ # 11-10, 0.1.0-dev.1109.33: copies are made two at a time (a folder of fifty compositions opened in Source had
+ # started thirty still renders at once and the Mac swapped), the last moment's asks first. And a 3D part asked for
+ # again by id (the game inspector re-reads what is picked on every frame) answers its own box on the frame: it
+ # answered its holder's, so the outline a click drew was gone a frame later.
@done
Scenario: PV3b. The store is managed in one place
Then Settings lists the store by project and kind with sizes, and offers Clear and Rebuild; copies whose source
diff --git a/runtime/live/src/lib.rs b/runtime/live/src/lib.rs
index a35b5f61..fec648db 100644
--- a/runtime/live/src/lib.rs
+++ b/runtime/live/src/lib.rs
@@ -169,14 +169,27 @@ impl Live {
// a 3D part's element holds its own props as the SDK's JSON (data-props) and its kind as data-3d: answered as
// those, so an inspector that asks again by id shows the part's props, not the holder's
let mut kind = kind.0.clone();
+ let mut part = None;
if let (Some(k), Some(own)) = (props.get("data-3d").and_then(Value::as_str).map(str::to_string), props.get("data-props").and_then(Value::as_str).and_then(|t| serde_json::from_str::<serde_json::Map<String, Value>>(t).ok())) {
kind = k;
+ part = raea_sys_frame::layer::key_from_props(&own);
props = own;
props.retain(|k, _| !k.starts_with("data-raea-"));
}
props.retain(|k, v| k != "children" && !(k.starts_with("on") && k[2..].starts_with(|c: char| c.is_ascii_uppercase())) && !v.is_null());
let text: String = kids.map(|ks| ks.iter().filter_map(|e| w.get::<raea_runtime_react::ReactText>(e).map(|t| t.0.clone())).collect()).unwrap_or_default();
- Some(json!({"id": id, "kind": kind, "owner": owner, "rect": rect, "props": props, "text": text}))
+ let mut e = json!({"id": id, "kind": kind, "owner": owner, "rect": rect, "props": props, "text": text});
+ // a 3D part's box is where it is drawn now, not its holder's (which has none): an inspector asking again by id
+ // as the scene moves lost the outline it had from the click
+ if let Some(key) = part {
+ let at = self.locate(std::slice::from_ref(&key), &[])["parts"][0].take();
+ if at.is_array() {
+ e["rect"] = at;
+ }
+ e["part"] = json!(true);
+ e["key"] = json!(key);
+ }
+ Some(e)
}
pub fn step(&mut self, f: i64, keys: &[String], pointer: Option<(f64, f64, bool)>) -> R<()> {