Skip to content

Align Python in the Windows dev tree with the install layout#262

Open
OlafRocket wants to merge 11 commits into
AcademySoftwareFoundation:developfrom
OlafRocket:python-dev-tree-alignment
Open

Align Python in the Windows dev tree with the install layout#262
OlafRocket wants to merge 11 commits into
AcademySoftwareFoundation:developfrom
OlafRocket:python-dev-tree-alignment

Conversation

@OlafRocket

Copy link
Copy Markdown
Contributor

Linked issues

None.

Summarize your change.

Makes embedded Python initialize and the xstudio Python package
importable when running build\run_xstudio.bat directly from a fresh
Windows dev build (no cmake --install required).

Describe the reason for the change.

Follow a previous PR which aligned the Windows dev tree with the
install layout for resources under share/xstudio/. Python was the last
broken piece: xstudio_root()-derived PYTHONHOME is
build/bin/python3/, but nothing stages vcpkg's tools/python3/ to that
location at build time (only at install time). Py_Initialize fails;
EmbeddedPython::setup() catches the exception and logs "Failed to setup
API"; Python features are unavailable for the rest of the dev session.

This PR mirrors the install rules' destinations in the dev build tree on
Windows.

Describe what you have tested and on which operating system.

Windows 10 Pro x64 with Visual Studio 2022, Qt 6.5.3 (msvc2019_64),
vcpkg, Ninja generator (preset WinNinjaReleaseLocal):

  • Clean rebuild from empty build/: cmake configure + ninja build
    succeed. build/bin/python3/ populated with vcpkg's tools/python3
    contents plus xstudio package and __pybind_xstudio.pyd.
  • Standalone build/bin/python3/python.exe -c "import xstudio; from xstudio.core import *" succeeds, confirming the package layout and
    .pyd are reachable.
  • build\run_xstudio.bat: launches with no "Failed to setup API"
    warning. The picture_in_picture toggle in the bottom bar is
    functional, confirming stock Python plugins are loaded via
    XSTUDIO_LOCAL_PLUGIN_PATHload_plugins_in_path().
  • cmake --install build --prefix install_test: install tree byte-identical
    to current develop. install_test/python/xstudio/ is not present,
    but this was already true on upstream/develop since the rule that
    produced that location was removed before this PR.

macOS and Linux: not retested as those code paths are untouched. All new
branches are guarded with if(WIN32).

Add a list of changes, and note any that might need special attention during the review.

  1. src/embedded_python/src/CMakeLists.txt: add a Windows-only build-time
    stage step that copies vcpkg's tools/python3/ to
    build/bin/python3/ using cmake -E copy_directory_if_different.

  2. python/CMakeLists.txt:

    • Windows branch: replace the existing python -m pip install .
      invocation with cmake -E copy_directory_if_different of
      python/src/xstudio/ to
      build/bin/python3/Lib/site-packages/xstudio/. Update the
      python_module custom target's DEPENDS to track the new output
      path.
    • Add an explicit Windows install(DIRECTORY ${WIN_PYTHON_SITE} DESTINATION bin/python3/Lib/site-packages) rule. Previously no
      explicit Windows install rule existed for the xstudio .py files;
      they reached the installer only as a side-effect of pip install .
      mutating vcpkg's tools/python3/ tree before the wholesale install
      rule for that tree ran.
    • Linux/macOS branches untouched.
  3. src/python_module/src/CMakeLists.txt: add WIN32 branch in
    OUTPUT_DIR selection so LIBRARY_OUTPUT_DIRECTORY for
    __pybind_xstudio.pyd is the dev-tree mirror of its install location.

The build-tree source paths of install rules changed (POSIX-style
bin/python/lib/python3.11/site-packages/ is gone on Windows; replaced
with Windows-style bin/python3/Lib/site-packages/), but the install
destination paths are byte-identical.

If possible, provide screenshots.

N/A — build system change with no UI impact.

MrFruitDude and others added 11 commits May 20, 2026 18:48
…ySoftwareFoundation#244)

The annotations exporter accessed the playhead via
session.viewed_container.playhead, which assumes the viewed container
is always a Playlist. When media is loaded by a Python plugin (e.g.
rdo_browser) that sets the viewer to a Subset, this crashes with
"'Subset' object has no attribute 'playhead'" because the Subset
class does not expose a playhead property.

Replace all 5 call sites with self.current_playhead(), which is
provided by PluginBase and returns the active playhead regardless
of the viewed container type.
…tion#247)

Signed-off-by: Ken McGaugh <ken@mcgaugh.co.uk>
Signed-off-by: Ken McGaugh <ken@wetafx.co.nz>
New self-contained viewport overlay plugin that displays annotations from
neighboring frames as semi-transparent, color-tinted overlays on the
current frame. Enables reviewers and animators to see annotation
progression across frames without scrubbing.

Architecture:
- HUDPluginBase subclass with configurable frames before/after, opacity
  falloff, and separate past/future tint colours
- Opacity and tint baked directly into copied Canvas items (strokes,
  captions, shapes), rendered via standard render_canvas() path
- Stack order 1.5 (below current annotations at 2.0, above image)
- Plugin-local bookmark cache built from frame.bookmarks() during
  playback — zero core data structure changes
- Canvas accessed via public AnnotationBase::user_data() API, no
  dependency on annotations plugin internals

Also adds set_opacity()/set_colour() setters to Stroke, matching the
pattern already established by Caption.

Signed-off-by: Julien Hery <jhery@rodeofx.com>
Co-Authored-By: Nicolas Felix <nfelix@rodeofx.com>
* Add numpy to pip installed packages

Signed-off-by: Ted Waine <ted.waine@gmail.com>
Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Tweak for set video range action

Signed-off-by: Ted Waine <ted.waine@gmail.com>
Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Handle missing Decklink hardware when drivers are installed (AcademySoftwareFoundation#238)

Signed-off-by: xShirae <xshiraayuki@gmail.com>
Signed-off-by: Ted Waine <ted.waine@gmail.com>
Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Initial checkin of filesystem_plugin prior to refactor.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* A ffmpeg constant changed, I believe the older one FF_PROFILE_UNKOWN has been obsolete for a while.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Cleanup GUI
Better filtering, got progress bar working, and version and date filtering.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Adding fileseq for the python libraries for the FileSystem Browser.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Got the progress bar to work correctly.
Also added a separate timing test where you can specify an output directory, not really for unit testing, but good for testing against real directories.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Fix for color scheme for right click menu.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Add readme.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Adding copyright/license info.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Adding (c).

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Dont be quite so agressive updating the UI, only do it every 5 secs or so.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Swapped file-browser with a history view.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Updated readme.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Fixing QML issue.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Demo of widget as a floating window.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Filtering fixes.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Switched to a tree-view with some "smart" collapsing of directories.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Fixed the file-loading issue, it was trying to load a relative path.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Double clicking on a directory changes the overall search window path.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Make the search case insensitive.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Adding different types of tree view. and recursion depths.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Minor tweak to prune empty folders if we are filtering.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Adding a directory view.

The directory view allows a more obvious browsing of the tree. For the very top of the directory tree we dont auto-scan for media, once you get down to 4 levels it will start scanning.
We have also made a config.json file to store configurations of things like the auto_scan_threashold, along with adding a list of folders that need to be ignored.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Filtering all the time.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* GUI update:
   * Fixed auto-complete
   * Tree view opens to node when path is entered in path dialog.
   * Added a refresh button
   * Tree view now persistent, with a nicer sidebar label.
   * Smart scan button now visible.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Added a preview mode, so when you click on a clip, it will automatically load it into the player
   * double click will load it into your target
   * Cursor keys will allow you to move through the results loading as you go (left right for icon view, up down for list view)
   * Enter will do the same as double click.
   * Preview playlist will be deleted on Enter.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Updated to have a common style, and synced style with xstudio.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* More style fixes, and also making menu options consistent between icon and list view:
* Adding Append menu option
* Adding copy path menu option
* Add compare menu option

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Adding a show-in-finder menu option.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* MInor bug fixes, cleaning threading.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Some code refactoring to simplify it, in particular the dispatch table.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Setup a interface class, so that if you want to change the back end you have a centralized area to do that.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Removed some debug output and removed an un-necesary header.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Fixed a padding issue.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

* Added ability to set the directory root.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>

---------

Signed-off-by: Ted Waine <ted.waine@gmail.com>
Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>
Signed-off-by: xShirae <xshiraayuki@gmail.com>
Signed-off-by: tedwaine <59868698+tedwaine@users.noreply.github.com>
Co-authored-by: Ted Waine <ted.waine@gmail.com>
Co-authored-by: xShirae <83482842+xShirae@users.noreply.github.com>
Co-authored-by: tedwaine <59868698+tedwaine@users.noreply.github.com>
…s, cross-platform docs (AcademySoftwareFoundation#246)

* Build system improvements: OTIO vcpkg migration, Windows fixes, cross-platform docs

Core build system
-----------------
- Migrate OpenTimelineIO from git submodule to vcpkg overlay port
  (cmake/vcpkg_overlay_ports/opentimelineio/). Removes extern/otio,
  .gitmodules, cmake/otio_patch.diff, and the OTIO_SUBMODULE option.
- OTIO portfile: on Windows, move .dll files from lib/ to bin/ (vcpkg
  convention for applocal.ps1 discovery) and rewrite generated
  Targets-*.cmake files so IMPORTED_LOCATION resolves correctly.
- Pin python3 to 3.11.11 in vcpkg.json.
- Lower CMake minimum from 3.28 to 3.26 for broader distro compatibility.
- Work around Qt 6.5/6.8 FindWrapOpenGL.cmake AGL bug on macOS by
  pre-creating WrapOpenGL::WrapOpenGL so Qt's find-module early-returns.
  Fixed upstream in Qt 6.9+; workaround can be removed once minimum
  supported Qt >= 6.9.

CMakePresets
------------
- Remove hardcoded Qt6_DIR from the default preset. Users now supply it
  via the Qt6_DIR environment variable, a CMakeUserPresets.json, or a
  one-off -D flag (documented in each build guide).
- Add VCPKG_OVERLAY_PORTS path so the new OTIO overlay is picked up.
- Add Ninja generator presets for macOS (arm / intel) and Linux — Release,
  RelWithDebInfo and Debug variants. Aligns with existing Windows Ninja
  presets.
- Un-hide WinDebug preset.
- Add VCPKG_OVERLAY_TRIPLETS to the Linux base preset.

Windows build fixes
-------------------
- Fix scripts/qt_install to use install(SCRIPT) + configure_file instead
  of install(CODE), so ${CMAKE_INSTALL_PREFIX} resolves at install time.
  Previously the configure-time prefix was baked in, which broke the
  CPack package target because CPack uses a different (staging) prefix.
- Remove the redundant early windeployqt call in src/launch/xstudio/src.
  The late call in scripts/qt_install now covers everything and runs
  after all other install rules have populated the install tree.
- In cmake/macros.cmake (default_options_qt), add RUNTIME_OUTPUT_DIRECTORY
  alongside LIBRARY_OUTPUT_DIRECTORY so *_qml.dll files land in build/bin
  on Windows (Windows uses RUNTIME for .dll, not LIBRARY).
- Fix Windows python install path mismatch in python/CMakeLists.txt:
  the build produces lib/python3.11/site-packages (Unix layout, because
  vcpkg's Python uses that layout on Windows), not Lib/site-packages.

Dev workflow
------------
- Generate build/run_xstudio.bat — a dev launcher that puts Qt's bin
  directory on PATH and forwards arguments to xstudio.exe, so xstudio
  can be run straight from the build tree without a windeployqt pass.

Documentation
-------------
- downloading_qt.md: add aqtinstall instructions (command-line, no Qt
  account required) as a recommended alternative to the GUI installer.
  Covers Linux, macOS and Windows.
- index.rst: add "Choosing a guide" section explaining the split between
  vcpkg-based guides (recommended) and distro-native guides (advanced).
- linux_generic.md: restructured around the new Qt6_DIR / user-preset
  workflow, removed submodule instructions, added optional Ninja section.
- macos.md: minor updates to reflect current dependency list and Qt
  workaround now handled in CMakeLists.txt.
- windows.md: full rewrite — unified "Set up the build environment"
  section using Enter-VsDevShell with -SkipAutomaticLocation, separate
  build sections for Visual Studio and Ninja generators, corrected Qt
  path example (C:/Qt not C:/Qt6), user-preset examples for both
  generators, note on run_xstudio.bat dev launcher.

Signed-off-by: Olaf Razzoli <olaf.razzoli@gmail.com>

* docs: simplify build guides and pin vcpkg

- Require Ninja as the CMake generator on all platforms; remove the
  "Faster builds with Ninja (optional)" sections and the Visual Studio
  generator option on Windows.
- Pin vcpkg to commit c2aeddd80357b17592e59ad965d2adf65a19b22f in all
  three guides for reproducible dependency builds.
- Document CMakeUserPresets.json as the single way to point CMake at
  the local Qt 6.5.3 install; drop the Qt6_DIR env-var and one-off
  -DQt6_DIR command-line paths.
- Note that --target package on Windows is slow and recommend a plain
  cmake --build build for dev iteration.
- Remove docs/reference/build_guides/developer_tips.md and the link
  to it from windows.md.

Signed-off-by: Olaf Razzoli <olaf.razzoli@gmail.com>

---------

Signed-off-by: Olaf Razzoli <olaf.razzoli@gmail.com>
* Merge updates from DNEG internal repo

Signed-off-by: Ted Waine <ted.waine@gmail.com>

* Re-sync to DNEG internal repo

Signed-off-by: Ted Waine <ted.waine@gmail.com>

* Win build compatibility tweaks

Signed-off-by: Ted Waine <ted.waine@gmail.com>

* Update docs and release notes

Signed-off-by: Ted Waine <ted.waine@gmail.com>

---------

Signed-off-by: Ted Waine <ted.waine@gmail.com>
…Foundation#257)

* Fix Windows file-URL handling in pathFromURL and Reveal Source

pathFromURL on Windows returned url.toString() - the full file URL
string with scheme, authority and URL-encoded reserved characters.
That string then flowed unchanged through every QML caller to
user-visible text (window title, clipboard, dialog text fields) and
to external process arguments (ffmpeg), producing artefacts like
"file:///Z:/path/foo.xst" in the window title and ffmpeg output
filenames such as "file:///Z:/foo.%23%23%23%23.%04d.jpg".

Replace the pathFromURL Windows branch with a delegation to
QUrl::toLocalFile() after patching the one URL shape Qt can't handle
on its own: xstudio constructs URLs as file://localhost//<drive>:/...,
which toLocalFile() interprets as a UNC \\localhost\<drive>:\... path.
Strip the localhost authority and collapse the doubled leading slash;
Qt's conversion then yields a clean drive-letter path. Standard file
URLs and real UNC URLs are handled by toLocalFile() unchanged.

Implement the previously-empty Windows branch of showURIS using
explorer.exe /select,<native-path>, calling pathFromURL to obtain the
clean drive-letter path. explorer.exe /select takes a single target
per invocation (unlike macOS open -R and Linux ShowItems, which
accept a list), so the Windows branch reveals only the first URL in
the input.

The pathFromURL non-Windows branch (`return url.path().replace("//",
"/")`) is unchanged; Linux and macOS behaviour is preserved.

Signed-off-by: Ben de Luca <bdeluca@gmail.com>

* VideoRendererDialog: handle user-typed hash pattern in choose_output

choose_output had three intended branches over the regex matches:

  - filename contains a numeric frame range (foo.0001.jpg): replace
    digits with #### and set audio output to <prefix>.aiff
  - filename has neither a frame number nor hashes (foo.jpg): inject
    #### and set audio output to <prefix>.aiff
  - filename already contains hashes (foo.####.jpg): no branch

The third case had no handler. Previously this was masked because Qt
URL-encoded the # characters to %23 when serializing the file dialog
URL, and the with_hashes regex matched the literal # character only.
The encoded form failed the regex, the third branch was indistin-
guishable from the second, and audio output auto-filled by accident
via the !with_hashes branch.

With the previous commit applying QUrl::toLocalFile() in pathFromURL
the path is fully decoded before the regex runs, with_hashes
correctly matches the literal ####, and the missing case surfaces as
audio output not auto-filling when the user types ####. Add the
explicit `else if (with_hashes)` branch: keep the path as the user
wrote it and set the audio filename via the same ext[1] + "aiff"
prefix used by the other two branches.

Signed-off-by: Ben de Luca <bdeluca@gmail.com>

---------

Signed-off-by: Ben de Luca <bdeluca@gmail.com>
…ation#258)

Windows clones with the default core.autocrlf=true convert .patch
files to CRLF on checkout. git apply (used by vcpkg overlay ports)
rejects CRLF in diff hunk headers ("corrupt patch at line N"),
breaking vcpkg builds. Forcing eol=lf on *.patch and *.diff makes
the working-tree files LF regardless of host autocrlf setting,
so the patch step works on every platform without per-developer
git config.

See hydralab issue AcademySoftwareFoundation#36.

Signed-off-by: Ben de Luca <bdeluca@gmail.com>
Mirrors the install-time Python layout in the build tree on Windows so
embedded Python initializes and the xstudio Python package is importable
when running build/run_xstudio.bat from a fresh dev build (no
cmake --install required).

- src/embedded_python/src/CMakeLists.txt: stage vcpkg's tools/python3 into
  build/bin/python3/ at build time via cmake -E copy_directory_if_different
  (incremental; ~150 MB on first build, near-zero on subsequent builds).
  Add configure-time guard for missing vcpkg python tree.
- python/CMakeLists.txt: on Windows, replace pip install . with
  cmake -E copy_directory_if_different of python/src/xstudio/ into
  build/bin/python3/Lib/site-packages/xstudio/. Update python_module
  target's DEPENDS for the new output path. Add an explicit Windows
  install(DIRECTORY ...) rule for the xstudio package (previously
  absent. Linux/macOS branches untouched.
- src/python_module/src/CMakeLists.txt: on Windows, route the
  __pybind_xstudio.pyd LIBRARY_OUTPUT_DIRECTORY to
  build/bin/python3/Lib/site-packages/xstudio/core/ built directly at
  the final location, .pdb co-located for debugger.

macOS and Linux unchanged. Install destination contents unchanged.

Signed-off-by: Olaf Razzoli <olaf.razzoli@gmail.com>
@tedwaine tedwaine force-pushed the develop branch 2 times, most recently from 80fa446 to e0c88d1 Compare June 22, 2026 13:48
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.

7 participants