Skip to content

Add plugin geometry injection API for the 3D map scene#7520

Open
mohsenD98 wants to merge 3 commits into
masterfrom
minimal-3d-plugin-geometry-injection
Open

Add plugin geometry injection API for the 3D map scene#7520
mohsenD98 wants to merge 3 commits into
masterfrom
minimal-3d-plugin-geometry-injection

Conversation

@mohsenD98

@mohsenD98 mohsenD98 commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

🚀 Description

Plugins currently have no way to draw custom geometry inside the 3D map view. This PR adds a minimal, stable API surface that lets any QField plugin inject and remove geometries from the 3D scene at runtime.

✨ How a plugin uses it

let canvas3D = iface.findItemByObjectName('mapCanvas3D')
if (!canvas3D) return  // 3D view not active

canvas3D.clearPluginGeometries()
canvas3D.addPluginGeometry(wkt, qgisProject.crs, '#FF6600')

Demo

Screencast.From.2026-06-05.22-09-00.mp4

Plugin

Example plugin qfield-3d-inject.zip
Example plugin qfield-3d-inject.zip

@mohsenD98 mohsenD98 self-assigned this Jun 5, 2026
@qfield-fairy

qfield-fairy commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

🍎 MacOS DMG universal builds

Download a MacOS DMG universal build of this PR for testing.
(Built from commit 650b46d)

📱 Android builds

Download an Android arm64 build of this PR for testing.
(Built from commit 650b46d)

Other Android architectures

🪟 Windows builds

Download a Windows build of this PR for testing and for arm64.

(Built from commit 650b46d)

🐧 Linux AppImage builds

Download a Linux AppImage build of this PR for testing.
(Built from commit 650b46d)

@nirvn nirvn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, while this gets to our objective, I'm -1 on the method we employ here.

Our approach should be injecting into the repeater3D actual Quick3DGeometry items that live within the plugin and get removed when the plugin is unloaded.

That gives us dynamic geometry, colors, line width, etc.

Also, if possible (I'd hope so 😉), these 3D geometries should live on outside of an existing 3D map view, so they aren't killed when the 3D map view itself is turned off.

@mohsenD98 mohsenD98 force-pushed the minimal-3d-plugin-geometry-injection branch from a4e60f6 to d7f66c1 Compare June 8, 2026 17:42
@mohsenD98

Copy link
Copy Markdown
Collaborator Author

Our approach should be injecting into the repeater3D actual Quick3DGeometry items that live within the plugin and get removed when the plugin is unloaded.
That gives us dynamic geometry, colors, line width, etc.

Done

Also, if possible (I'd hope so 😉), these 3D geometries should live on outside of an existing 3D map view, so they aren't killed when the 3D map view itself is turned off.

I am thinking .. :)


Plugin updated.

@mohsenD98 mohsenD98 force-pushed the minimal-3d-plugin-geometry-injection branch from d7f66c1 to 650b46d Compare June 12, 2026 15:46
@nirvn nirvn closed this Jun 14, 2026
@nirvn nirvn reopened this Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants