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

Hackathon additions #99

Merged
merged 11 commits into from
Jan 22, 2025
Merged

Hackathon additions #99

merged 11 commits into from
Jan 22, 2025

Conversation

ruaridhg
Copy link
Collaborator

No description provided.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@ruaridhg ruaridhg requested a review from sfmig November 11, 2024 15:55
Copy link
Collaborator

@sfmig sfmig left a 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
Copy link
Collaborator

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",
Copy link
Collaborator

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)
Copy link
Collaborator

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?)

Comment on lines +151 to +155
# 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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# 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")
Copy link
Collaborator

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?

Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# obj = bpy.data.objects[3] #Sphere

Comment on lines +334 to +353
### 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"
# )
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
### 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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# bpy.ops.render.render(write_still=True)

Copy link
Collaborator

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)

Comment on lines +494 to +500
# 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'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# 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'

Comment on lines +509 to +515
##bpy.context.scene.render.filepath = str(output_path)

# Render the image
# bpy.ops.render.render(write_still=True)


# %% Helper functions
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
##bpy.context.scene.render.filepath = str(output_path)
# Render the image
# bpy.ops.render.render(write_still=True)
# %% Helper functions

Copy link
Collaborator

@sfmig sfmig left a 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!

@ruaridhg ruaridhg merged commit 8be1d99 into main Jan 22, 2025
8 checks passed
@ruaridhg ruaridhg deleted the hackathon-additions branch January 22, 2025 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants