diff --git a/Makefile b/Makefile index 4522dacb..f2640958 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ test: version := $(shell grep version pyproject.toml | grep -o -E "\b[0-9]+\.[0-9]+\.[0-9]+\b") template: - cd 'molecularnodes/assets/template/' && zip -r 'Molecular Nodes.zip' 'Molecular Nodes' + python build.py release: git clean -dfX diff --git a/build.py b/build.py new file mode 100644 index 00000000..ae123f55 --- /dev/null +++ b/build.py @@ -0,0 +1,24 @@ +import os +import zipfile + + +# zips up the template file +def zip_template(): + # Define the directory and zip file paths + dir_path = 'molecularnodes/assets/template/Molecular Nodes' + zip_file_path = 'molecularnodes/assets/template/Molecular Nodes.zip' + + # Create a ZipFile object in write mode + with zipfile.ZipFile(zip_file_path, 'w', zipfile.ZIP_DEFLATED) as zipf: + # Walk the directory tree and add files to the zip file + for root, dirs, files in os.walk(dir_path): + for file in files: + # Get the path of the file + file_path = os.path.join(root, file) + # Add the file to the zip file + zipf.write(file_path, arcname=os.path.relpath( + file_path, start='molecularnodes/assets/template/')) + + +if __name__ == "__main__": + zip_template() diff --git a/docs/build_node_docs.py b/docs/build_node_docs.py index 68e9109c..cbb10f35 100644 --- a/docs/build_node_docs.py +++ b/docs/build_node_docs.py @@ -33,7 +33,7 @@ def get_values(sockets): elif dtype == "Vector": default = [round(x, 2) for x in socket.default_value] elif dtype == "Material": - default = '`MN_atomic_material`' + default = '`MN Default`' elif dtype == "Color": default = col_to_rgb_str(socket.default_value) else: diff --git a/molecularnodes/assets/MN_data_file.blend b/molecularnodes/assets/MN_data_file.blend index 3837cc07..c7ca7ad0 100644 Binary files a/molecularnodes/assets/MN_data_file.blend and b/molecularnodes/assets/MN_data_file.blend differ diff --git a/molecularnodes/assets/template/Molecular Nodes.zip b/molecularnodes/assets/template/Molecular Nodes.zip index 9864d38e..f4db1560 100644 Binary files a/molecularnodes/assets/template/Molecular Nodes.zip and b/molecularnodes/assets/template/Molecular Nodes.zip differ diff --git a/molecularnodes/assets/template/Molecular Nodes/startup.blend b/molecularnodes/assets/template/Molecular Nodes/startup.blend index 61f7a80a..dbb6c694 100644 Binary files a/molecularnodes/assets/template/Molecular Nodes/startup.blend and b/molecularnodes/assets/template/Molecular Nodes/startup.blend differ diff --git a/molecularnodes/blender/nodes.py b/molecularnodes/blender/nodes.py index 78ba02ad..a2b5ac66 100644 --- a/molecularnodes/blender/nodes.py +++ b/molecularnodes/blender/nodes.py @@ -218,20 +218,20 @@ def append(node_name, link=False): return bpy.data.node_groups[node_name] -def MN_base_material(): +def material_default(): """ - Append MN_atomic_material to the .blend file it it doesn't already exist, + Append MN Default to the .blend file it it doesn't already exist, and return that material. """ - mat_name = 'MN_atomic_material' + mat_name = 'MN Default' mat = bpy.data.materials.get(mat_name) if not mat: print('appending material') bpy.ops.wm.append( directory=os.path.join(MN_DATA_FILE, 'Material'), - filename='MN_atomic_material', + filename='MN Default', link=False ) @@ -265,7 +265,7 @@ def assign_material(node, material='default'): if not material: pass elif material == "default": - material_socket.default_value = MN_base_material() + material_socket.default_value = material_default() else: material_socket.default_value = material @@ -380,7 +380,7 @@ def create_starting_nodes_starfile(object, n_images=1): node_name = f"MN_starfile_{object.name}" # Make sure the aotmic material is loaded - MN_base_material() + material_default() # create a new GN node group, specific to this particular molecule group = new_group(node_name) node_mod.node_group = group diff --git a/molecularnodes/ui/panel.py b/molecularnodes/ui/panel.py index bb26a63f..af831b17 100644 --- a/molecularnodes/ui/panel.py +++ b/molecularnodes/ui/panel.py @@ -158,10 +158,10 @@ def panel_scene(layout, context): else: world.prop(bpy.data.scenes["Scene"].eevee, "taa_render_samples") world.label(text="Background") - world.prop(world_shader.inputs[1], 'default_value', text="World Lighting") + world.prop(world_shader.inputs[1], 'default_value', text='HDRI Strength') row = world.row() row.prop(scene.render, 'film_transparent') - row.prop(world_shader.inputs[2], 'default_value', text="") + row.prop(world_shader.inputs[2], 'default_value', text="Background") col = grid.column() col.label(text="Camera Settings")