Lower render resolution to 50.

This commit is contained in:
jmsgrogan 2017-10-24 15:05:25 +01:00
parent 848d503fc9
commit cfb558e540
11 changed files with 27 additions and 6 deletions

View file

@ -1,4 +1,5 @@
import os
import random
import bpy
import product_gen.generate_lamp
import rendering.setup_scene
@ -7,7 +8,7 @@ import rendering.setup_renderer
def generate(shape,
height,
radius,
color,
color,
output_prefix,
is_final=False):
@ -49,4 +50,6 @@ def generate(shape,
bpy.context.scene.render.filepath = prefix + ".png"
bpy.ops.render.render(write_still=True)
bpy.ops.wm.save_as_mainfile(filepath=prefix + ".blend")
bpy.ops.wm.save_as_mainfile(filepath=prefix + ".blend")
return height, radius, color

View file

@ -19,4 +19,4 @@ def setup_renderer(engine="CYCLES"):
bpy.context.scene.render.resolution_y = 600.0
bpy.context.scene.render.tile_x = 32
bpy.context.scene.render.tile_y = 32
bpy.context.scene.render.resolution_percentage = 100.0
bpy.context.scene.render.resolution_percentage = 50.0

View file

@ -13,6 +13,7 @@ if __name__ == "__main__":
shape_params = json.loads(argv[0])
shape = shape_params['shape']
output = shape_params['output']
print(output)
if not os.path.exists(os.getcwd() + "/" + output):
os.makedirs(os.getcwd() + "/" + output)

View file

@ -1,3 +1,7 @@
"""
First pass shape generation.
"""
import os
import sys
import random
@ -10,17 +14,30 @@ if __name__ == "__main__":
argv = sys.argv
argv = argv[argv.index("--") + 1:]
shape_params = json.loads(argv[0])
shape = shape_params['shape']
output = shape_params['output']
if not os.path.exists(os.getcwd() + "/" + output):
os.makedirs(os.getcwd() + "/" + output)
# Global bounding box
bbox_xmax = 2.2
bbox_ymax = 2.5
# Minimum feature sizes
feature_xmin = 0.4
feature_ymin = 1.0
height = 1.0 + random.random()*1.5
radius = 0.2 + random.random()*1.0
color = [0.1, 0.1, 0.1]
product_gen.generate_product.generate(shape, height, radius, color, output)
height, radius, color = product_gen.generate_product.generate(shape,
height,
radius,
color,
output)
shape_parameters = {"shape": shape,
"height": height,

Binary file not shown.

Binary file not shown.

View file

@ -1 +1 @@
{"height": 2.23382656395708, "color": [0.1, 0.1, 0.1], "radius": 1.1783351658626844, "shape": "cone"}
{"color": [0.1, 0.1, 0.1], "shape": "cone", "radius": 1.0698675312816335, "height": 2.122232726076932}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View file

@ -7,7 +7,7 @@ from argparse import ArgumentParser
if __name__ == "__main__":
shape = "bio"
shape = "pendant"
output = "test"
if not os.path.exists(os.getcwd() + "/" + output):