Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

name of open file doesn't show in title bar when wrapped in qt #68

Open
hannesdelbeke opened this issue Apr 11, 2023 · 4 comments
Open
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@hannesdelbeke
Copy link
Collaborator

would be great to show name of open scene in blender title bar

@hannesdelbeke
Copy link
Collaborator Author

hannesdelbeke commented Jun 4, 2023

bpy.data.filepath contains the filename

show path if file open
image
show star if file dirty
image
show Blender if new file/ no file path

>>> bpy.data.filepath
'C:\\Users\\user\\Downloads\\testcase.blend'

@hannesdelbeke
Copy link
Collaborator Author

hannesdelbeke commented Jun 4, 2023

we either need to subscribe to a hook in Blender, or create a listener.

msgbus

msgbus might let us subscribe to changes in filepath or dirty state.

app handlers

app handlers might also be an option

  • bpy.app.handlers.load_post on loading a new blend file (after)
    (but does this trigger when we save a new blend?)
  • bpy.app.handlers.save_post: on saving a blend file.

might also need

  • bpy.app.handlers.persistent: to maintain the handlers between sessions, just like we use for the bqt operator

it seems app handlers can handle file path but not dirty state of the blend session

@hannesdelbeke hannesdelbeke changed the title show name of open scene in blender title bar name of open file doesn't show in title bar when wrapped in qt Jun 5, 2023
@hannesdelbeke hannesdelbeke added the bug Something isn't working label Jun 5, 2023
@hannesdelbeke
Copy link
Collaborator Author

current workaround: disable qt wrapping with BQT_DISABLE_WRAP set to 1

@hannesdelbeke hannesdelbeke added the good first issue Good for newcomers label Jun 13, 2023
@hannesdelbeke
Copy link
Collaborator Author

blender 4 slightly changed it. showing unsaved for new scene
image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant