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

Option to insert frames for Material properties when possible #965

Open
njsymanz opened this issue Aug 23, 2023 · 2 comments
Open

Option to insert frames for Material properties when possible #965

njsymanz opened this issue Aug 23, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@njsymanz
Copy link

Describe your feature request

I am generating training data for DL, and rather than storing thousands of images, I would like to save a .blend file where the data for each image to be rendered is stored in frames. Since I am randomizing the materials of the objects, I need to be able to insert frames for each one.

As a temporary solution, I modified Material.set_principled_shader_value() to accept a "frame" argument similar to some of the methods in the Entity class. This takes care of the cases where I only need a uniform material, but ideally I would be able to apply random texture images (such as from cctextures) on individual frames. Similarly, being able to set a world background in a frame would be useful as well.

Describe a possible solution

For texture images, it doesn't seem like replacing the image can be keyframed. With my very limited knowledge of Blender and what I could scrape together from my Google searches, it seems the common workaround is to use nested Mix shaders and adjust the mix factors between 0 and 1 to select the visible texture.

@njsymanz njsymanz added the enhancement New feature or request label Aug 23, 2023
@cornerfarmer
Copy link
Member

As you say, unfortunately its not possible to set keyframes for textures.
Why do you want to store your data into blend files? In the end, when training your neural networks, you need to render the images anyway right?

@njsymanz
Copy link
Author

I'm hoping by separating the process this way I can optimize the individual parts a little better. Blend files also don't take as much space with more images, and it allows me to make adjustments to some parts of the scene without redoing all the physics simulation later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
2 participants