|
15 | 15 |
|
16 | 16 | parser = argparse.ArgumentParser(description='Render object and by-products for use in photometric stereo') |
17 | 17 | parser.add_argument('--views', type=int, default=5, help='number of views to be rendered') |
18 | | -parser.add_argument('-num_of_lights', type=int, default=2, help='number of light angles to be rendered') |
| 18 | +parser.add_argument('-num_of_lights', type=int, default=1, help='number of light angles to be rendered') |
19 | 19 | parser.add_argument('-obj', type=str, help='Path to the obj file to be rendered.') |
20 | 20 | parser.add_argument('-output_folder', type=str, default='/tmp', help='The output path') |
21 | 21 | parser.add_argument('--scale', type=float, default=1, help='Scaling factor applied to model. Depends on size of mesh.') |
@@ -153,7 +153,6 @@ def setup_nodes(): |
153 | 153 |
|
154 | 154 | bias_normal = tree.nodes.new(type="CompositorNodeMixRGB") |
155 | 155 | bias_normal.blend_type = 'ADD' |
156 | | -# bias_normal.use_alpha = True |
157 | 156 | bias_normal.inputs[2].default_value = (0.5, 0.5, 0.5, 0) |
158 | 157 | links.new(scale_normal.outputs[0], bias_normal.inputs[1]) |
159 | 158 |
|
@@ -210,8 +209,9 @@ def main_flow(): |
210 | 209 | light_directions = {} # saved and will be written to file |
211 | 210 |
|
212 | 211 | for i in range(0, args.views): |
| 212 | + |
213 | 213 | print("Rotation {}, {}".format((stepsize * i), radians(stepsize * i))) |
214 | | -file_path = os.path.join(args.filepath, "obj_rotation" + str(i), "") |
| 214 | +file_path = os.path.join(args.filepath, "obj_rotat" + str(i), "") |
215 | 215 |
|
216 | 216 | depth_file_output.file_slots[0].path = file_path + "depth" |
217 | 217 | normal_file_output.file_slots[0].path = file_path + "normal" |
@@ -242,10 +242,11 @@ def main_flow(): |
242 | 242 | else: |
243 | 243 | objct = obj |
244 | 244 |
|
245 | | -# objct.rotation_euler[2] += radians(stepsize) |
246 | | -objct.rotation_euler[0] += radians(stepsize / 2) # rotate object |
| 245 | +# rotate object around x and z axis (this is just some arbitrary choice to create different views...) |
| 246 | +objct.rotation_euler[2] += radians(stepsize / 2) |
| 247 | +objct.rotation_euler[0] += radians(stepsize / 2) |
247 | 248 |
|
248 | | -# return exit code different than 0 |
| 249 | +# return exit code different than 0 if some exception is thrown |
249 | 250 | try: |
250 | 251 | main_flow() |
251 | 252 | except: |
|
0 commit comments