feat(euryopa): two-way live bridge with INU_Tools (Blender) - #11
Open
INU-ez wants to merge 8 commits into
Open
Conversation
File-based bridge under <game>/ariane/bridge that keeps an Ariane map session and the INU_Tools Blender addon in sync in real time. Instances are tracked by a stable GUID (IPL filter key + index) that survives save/reload. Live sync (30 Hz Ariane / 20 Hz Blender, throttled + freshness-gated): - moves: selected instance transforms stream both ways (PollBlenderLiveIn / WriteArianeLiveState); whoever moved last wins. - camera: eye/target/up streamed both ways. Ariane's camera is roll-free by design, so only the up-vector sign is taken and a clean up is rebuilt in the view plane; Blender rebuilds its view_rotation from forward+up (no to_track_quat roll flip). Camera is applied before Timecycle so the whole frame uses one position (fixes the sky/top flashing on fast moves). - selection: two-way, last change wins. Authoring: - CreateBridgeInstance: spawn a new instance of an existing model (E-1), driven by duplicate-detection on the Blender side. - CreateBridgeModel: register a brand-new model from loose DFF/TXD/COL plus an optional linked LOD, then spawn+select it (E-2). - soft delete/restore synced from Blender (PollBlenderDeletes), with a mass-vanish guard so a file reload can't wipe the scene. Arbitration: each side only drives while its window is OS-foreground, so the two never fight over the camera/selection and the app doesn't lag when the other window has focus.
…ltip the options Export to Blender (ExportSelectedToBlender): - Emit a placement line for EVERY selected instance, exporting each model's .dff/.txd/.col only once (std::unordered_set). The old per-model dedup skipped the whole instance, so reused models (GTA III roads/land are one model placed many times) only sent a single copy. Return the placement count, not the model count; toast "Sent N object(s)". - New HD companion (bool hdToo, "HD" checkbox): if a selected model is a LOD (LOD<name>), also send its high-detail model at the LOD instance's transform (iid=-1, so moving it in Blender won't move the LOD instance) — mirrors the existing LOD-from-HD option, so exporting a distant LOD brings the real one too. - Tooltips on the button and every option (Auto TXD / Vanilla / IDE / IPL / LOD / COL / HD) explaining what each sends.
…sections The bridge guid is <iplFilterKey>#<m_iplIndex>, and it must be unique per instance or the reverse sync moves the wrong one and the re-import dedup misfires. Streamed binary IPL instances (iplstore.cpp) collided: SA loads one map as a text IPL PLUS many binary sections (SetupRelatedIPLs loads <name>_stream0/1/… all sharing the same filter key), so a per-section index made LAw2_stream0#60 == LAw2_stream1#60 — moving one moved a different model. Fix: one continuous index across a map's text IPL and all its streamed sections. FileLoader::NextIplInstIndex() (returns iplInstCounter++, reset per map in LoadScene) is now called from both the text loader and iplstore's LoadIpl, so every instance of a map gets a unique, stable #index. Declared inside namespace FileLoader (fileloader.cpp is wrapped in it — a global decl gave an LNK2019). GTA III (text IPLs only) is unaffected.
Owner
|
hi i'll check when i have some time, thanks for the PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
A file-based, real-time two-way bridge between an Ariane (euryopa) map session and the
INU_Tools Blender addon. You select objects in Ariane, hit Export to Blender, edit them
in Blender, and the changes come back into the running session without a restart — geometry,
textures, collision, transforms, camera and selection.
No networking is involved. Both sides atomically write and read small files under
<game>\ariane\bridge\{inbox,outbox,live,overrides}(via the existingGetArianeDataPath()),Ariane polling at ~30 Hz and Blender at ~20 Hz.
Everything here is additive: it sits on top of the existing custom-import / hot-reload /
override machinery and does not change any existing behavior.
What it does
LOD and COL. Toggles for
Auto TXDandVanillasit next to the button.override, so the model updates in place.
Instance identity
Instances are addressed by a stable GUID derived from the IPL file and the instance's index in
it. Deleted rows are commented out rather than removed, so indices stay stable and the same
object keeps its ID across a save/reload cycle.
Two non-obvious bits, in case they matter during review
(
m_upis always(0,0,1)andCamera::TurnUpOrDownonly ever fitsm_up_z), so from Blenderonly the sign of the up-vector is taken, and a clean roll-free up is rebuilt in the new frame.
Feeding a tilted up straight into
m_uptilts the horizon permanently.timecycle::Update(). Previously the Blender-driven snaplanded later in the frame, so during a fast move the sky colours were still computed for the
previous position while the geometry was already rendered at the new one — the top of the
screen flashed white. The order is now: Ariane input → Blender snap →
update()→ timecycle→ render.
Files touched
tools/euryopa/objectinst.cpptools/euryopa/gui.cppExport to Blenderbutton, toggles, poller callstools/euryopa/colstore.cpp.colcan be rebuilttools/euryopa/modloader.cpp/.htools/euryopa/euryopa.cpp/.htools/euryopa/objectdef.cppObjectDef::Reload()tools/euryopa/txdstore.cppForceTxdReload()tools/euryopa/collision.cpp/.h.gitignoreRoughly 1400 lines, all inside
tools/euryopa/.Status — opened as a draft on purpose
San Andreas: working.
GTA III / Vice City: working.
Notes
Happy to split this into smaller PRs, put it behind a build flag, or reshape anything to fit
how you'd rather structure it — just say the word.