-
Notifications
You must be signed in to change notification settings - Fork 0
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
Hackathon additions #99
Conversation
Co-authored-by: Dolly Chen <[email protected]>
Co-authored-by: Lawrence Binding <[email protected]>
Co-authored-by: Lawrence Binding <[email protected]>
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
looks fun!
I only had a quick look and didn't try this out myself, so mainly focused on typos/phrasing bits, and highlighting things that looked confusing.
Hope it helps! Good luck with the hackathon!
help="Input frame number to render", | ||
) | ||
|
||
# LB: Add basename |
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.
what is LB? 👀
"-o", | ||
"--output", | ||
"-b", | ||
"--basename", |
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.
Is this a prefix for the exported frames, or for the blender file?
Maybe the name and help can be changed to explain this a bit more
# bpy.ops.preferences.addon_install(filepath=p) | ||
# if addon_name not in bpy.context.preferences.addons: | ||
# bpy.ops.preferences.addon_enable(module=addon_name) | ||
print(p) |
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.
Should this and the following print statement be removed? (are they debugging remains?)
# LB if its already installed don't do anything | ||
# if addon_name not in bpy.context.preferences.addons: | ||
# bpy.ops.preferences.addon_install(filepath=p) | ||
# if addon_name not in bpy.context.preferences.addons: | ||
# bpy.ops.preferences.addon_enable(module=addon_name) |
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.
# LB if its already installed don't do anything | |
# if addon_name not in bpy.context.preferences.addons: | |
# bpy.ops.preferences.addon_install(filepath=p) | |
# if addon_name not in bpy.context.preferences.addons: | |
# bpy.ops.preferences.addon_enable(module=addon_name) |
Since it is commented out?
print("HERE") | ||
# RENDERING | ||
# Randomise geometry | ||
bpy.ops.node.randomise_all_geometry_sockets("INVOKE_DEFAULT") |
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.
It seems like this script has been repurposed to run rendering - so maybe the name should be changed?
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.
I was further confused cause there is another script called "scripts/install_and_enable_addons_render.py" -- maybe these two scripts could be made more distinct?
active_obj = obj | ||
elif "Sphere" in str(obj): | ||
active_obj = obj | ||
# obj = bpy.data.objects[3] #Sphere |
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.
# obj = bpy.data.objects[3] #Sphere |
### MATERIALS | ||
# if args.output is not None: | ||
# out_path_to_file = args.output[0] | ||
# with open(out_path_to_file, "r") as in_file_obj: | ||
# text = in_file_obj.read() | ||
# # convert the text into a dictionary | ||
# out_data = json.loads(text) | ||
|
||
# out_data["materials"] | ||
# print("Output file for key names provided") | ||
|
||
# # Based on ouput file dictionary keys | ||
# # TODO: - use output file keys and type of values | ||
# # to replicated code below | ||
|
||
# else: | ||
# print( | ||
# "No Output file for key names \ | ||
# provided - generate from .blend file objects" | ||
# ) |
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.
### MATERIALS | |
# if args.output is not None: | |
# out_path_to_file = args.output[0] | |
# with open(out_path_to_file, "r") as in_file_obj: | |
# text = in_file_obj.read() | |
# # convert the text into a dictionary | |
# out_data = json.loads(text) | |
# out_data["materials"] | |
# print("Output file for key names provided") | |
# # Based on ouput file dictionary keys | |
# # TODO: - use output file keys and type of values | |
# # to replicated code below | |
# else: | |
# print( | |
# "No Output file for key names \ | |
# provided - generate from .blend file objects" | |
# ) | |
filepath=str(output_path) | ||
) | ||
|
||
# bpy.ops.render.render(write_still=True) |
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.ops.render.render(write_still=True) |
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.
(and same for other one-lines commented out below)
# Set resolution and format | ||
# bpy.context.scene.render.resolution_x = 554 | ||
# bpy.context.scene.render.resolution_y = 448 | ||
# bpy.context.scene.render.image_settings.file_format = 'PNG' | ||
|
||
# Ensure render engine is set | ||
# bpy.context.scene.render.engine = 'CYCLES' # or 'BLENDER_EEVEE' |
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.
# Set resolution and format | |
# bpy.context.scene.render.resolution_x = 554 | |
# bpy.context.scene.render.resolution_y = 448 | |
# bpy.context.scene.render.image_settings.file_format = 'PNG' | |
# Ensure render engine is set | |
# bpy.context.scene.render.engine = 'CYCLES' # or 'BLENDER_EEVEE' |
##bpy.context.scene.render.filepath = str(output_path) | ||
|
||
# Render the image | ||
# bpy.ops.render.render(write_still=True) | ||
|
||
|
||
# %% Helper functions |
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.scene.render.filepath = str(output_path) | |
# Render the image | |
# bpy.ops.render.render(write_still=True) | |
# %% Helper functions |
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.
looks fun!
I only had a quick look and didn't try this out myself, so mainly focused on typos/phrasing bits, and highlighting things that looked confusing.
Hope it helps! Good luck with the hackathon!
No description provided.