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

[Codebase] Automatically find or add world #334

Merged
merged 9 commits into from
Aug 20, 2024

Conversation

Lilaa3
Copy link
Collaborator

@Lilaa3 Lilaa3 commented Apr 21, 2024

Possible solution to #330
Never changes the actual scene.world, as that should be left to the user, the important logic is in create_or_get_world.
This will almost never create a world because of the f3d nodes library having its own world

@Lilaa3
Copy link
Collaborator Author

Lilaa3 commented Jun 11, 2024

@Dragorn421 could you look at this at some point?

@Lilaa3
Copy link
Collaborator Author

Lilaa3 commented Jul 4, 2024

Would an exception or warning popup work better?

@Lilaa3 Lilaa3 changed the title Automatically find or add world [Codebase] Automatically find or add world Aug 19, 2024
Copy link
Contributor

@Dragorn421 Dragorn421 left a comment

Choose a reason for hiding this comment

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

great!

@Dragorn421 Dragorn421 added the merge soon Will be merged in a few days at most if nothing else comes up label Aug 19, 2024
@Dragorn421
Copy link
Contributor

Dragorn421 commented Aug 19, 2024

This will fix #330

return scene.world
if bpy.data.worlds:
world: World = bpy.data.worlds.values()[0]
print(f'No world selected in scene, selected the first one found in this file "{world.name}".')
Copy link
Contributor

Choose a reason for hiding this comment

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

actually I just realized this severely spams the console. Could you add a counter for this print and only print it the first 10 times or something
use a dirty global variable :)

Copy link
Contributor

@Dragorn421 Dragorn421 left a comment

Choose a reason for hiding this comment

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

thanks

@Dragorn421 Dragorn421 added bug Something isn't working codebase Code maintenance/cleanup labels Aug 19, 2024
@Dragorn421 Dragorn421 merged commit 098041f into Fast-64:main Aug 20, 2024
1 check passed
@Lilaa3 Lilaa3 deleted the automatically_add_world branch August 24, 2024 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working codebase Code maintenance/cleanup merge soon Will be merged in a few days at most if nothing else comes up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants