-
Notifications
You must be signed in to change notification settings - Fork 48
WIP: speedup light effects by using shared material for drones #43
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
base: main
Are you sure you want to change the base?
Conversation
use a single common material for all drones and animate drone.color instead, with injecting that into the shader node trees of objects BREAKING CHANGE: old files are not compatible with this change yet
… array index (and also fix typing)
…terial per drone to new style with shared material
…of the 3D viewport on migration to new color-handling
I created a function for that migration, see |
The operation is ready, called |
… views of the 3D viewport on migration to new color-handling
… is warn, not info
Looks like you've found it already :) (
I think that it is probably time to introduce a version number in |
I added a version property and automated migrations based on the version numbers. Might be over complicated, but it works now. Migration always starts from version 1 and should call all migration operators, which automatically decide to run and bump or just bump or not touch the version etc. Tested with old files, new files, empty files, seem to be working now. |
update_pyro_particles_of_object(drone) | ||
|
||
|
||
def config_logging(*args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not mess around with global settings like logging configuration. If you need it for development purposes, that's okay, but do not invoke it unconditionally for end users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thx
def set_all_shading_color_types_to_object() -> None: | ||
"""Sets the object color source of the solid and wireframe | ||
shading types of the 3D Viewport to use object color.""" | ||
shading = getattr(bpy.context.space_data, "shading", None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bpy.context.space_data
might be a completely different object depending on how the workspace of the user is set up. We need to find the 3D viewport with find_one_3d_view()
or find_all_3d_views()
and then work on those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@ntamas all your comments answered so far, and also added warnings properly. Please recheck. |
This PR changes a fundamental concept in how colors are stored for Skybrush drone shows: we do not have a detached material for each drone any more, but have a common template material only, and use a different shader node tree that inputs object.color into the node tree. This should speed up color and light effects handling and export substantially! The PR is not ready, TODOs are summarized below:
bpy.context.space_data.shading.color_type = 'OBJECT'