glitch3d 0.2.2.9 → 0.2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 835dc42739a734d286312bca49481c45f8d1ec88
4
- data.tar.gz: abddf1b391d40fd11188961cf319d5f21649619f
3
+ metadata.gz: 7ce49988a7ab1cee9c39361b111a21bad4f1a1b1
4
+ data.tar.gz: 83db6ce2c18d0be3ea93da87076b9569a92850a8
5
5
  SHA512:
6
- metadata.gz: f62258dbf68540d84ea94c09df6858349899d8b40849c5f67e68e2707f50b85899e913b4273b2caf7745967d91f6c575f8fcf29c2c8e035f662521cfd57391e1
7
- data.tar.gz: c92863107ee547c99c839e0e37541431ed668e605dd3fd8183c104e928653bef638fdeb0cc17f007934c40502b16e0c1f2e19402841ac339782dd55f7d7e7ccf
6
+ metadata.gz: 987801548e975c36e054216650b0d5e4b8c2673c4056b21b74d9d6e890ad5802a5e4f0adf5842ca6902027145a8eb145346b314e4f2c0753bf159272aaa73af4
7
+ data.tar.gz: 15fa6d775fa8a3c3d11a59cd85ee33c89be83072eabd48053007d0c6acc534ec90548883a6aed0a48c3eb87e4807a0c43ceea334047197b861f37866e6cb6f4f
@@ -41,7 +41,7 @@ bpy.ops.mesh.primitive_plane_add(location=(0, 0, -2))
41
41
  floor = last_added_object('PLANE')
42
42
  bpy.data.groups['Plane'].objects.link(floor)
43
43
  floor.scale = (20,20,20)
44
- subdivide(floor, 8)
44
+ subdivide(floor, int(random.uniform(0, 7)))
45
45
  displace(floor)
46
46
  texture_object(floor)
47
47
 
@@ -18,7 +18,7 @@ BLUE = (0.1, 0.1, 0.8, 1)
18
18
  PINK = (0.8, 0.2, 0.7, 1.0)
19
19
  WORDS = string.ascii_lowercase
20
20
 
21
- def debug():
21
+ def pry():
22
22
  code.interact(local=dict(globals(), **locals()))
23
23
  sys.exit("Aborting execution")
24
24
 
@@ -405,8 +405,7 @@ def pitched_array(minimum, maximum, pitch):
405
405
  return list(map(lambda x: (minimum + pitch * x), range(int((maximum - minimum) / pitch))))
406
406
 
407
407
  def still_routine(index = 1):
408
- CAMERA.location.x = INITIAL_CAMERA_LOCATION[0] + round(random.uniform(-2, 2), 10)
409
- CAMERA.location.y = INITIAL_CAMERA_LOCATION[1] + round(random.uniform(-2, 2), 10)
408
+ CAMERA.location = mathutils.Vector(INITIAL_CAMERA_LOCATION) + mathutils.Vector((round(random.uniform(-3, 3), 10),round(random.uniform(-3, 3), 10),round(random.uniform(-3, 3), 10)))
410
409
  randomize_reflectors_colors()
411
410
  map(move_ocean, OCEAN)
412
411
  map(make_object_glossy, OCEAN)
@@ -18,16 +18,17 @@ def get_args():
18
18
  parser.add_argument('-m', '--mode', help="quality mode: low | high")
19
19
  parser.add_argument('-p', '--path', help="root path of assets")
20
20
  parser.add_argument('-a', '--animate', help="render animation") # bool
21
+ parser.add_argument('-d', '--debug', help="render blank scene") # bool
21
22
  parsed_script_args, _ = parser.parse_known_args(script_args)
22
23
  return parsed_script_args
23
24
 
24
25
  args = get_args()
25
26
  file = args.file
26
27
  mode = args.mode
28
+ debug = (args.debug == 'True')
27
29
  path = str(args.path)
28
30
  animate = (args.animate == 'True')
29
31
  shots_number = int(args.shots_number)
30
-
31
32
  #####################################
32
33
  #####################################
33
34
  #####################################
@@ -91,41 +92,43 @@ SUBJECT.select = True
91
92
  bpy.ops.object.origin_set(type="ORIGIN_CENTER_OF_MASS")
92
93
  SUBJECT.location = ORIGIN
93
94
  make_object_glossy(SUBJECT, YELLOW, 0.01)
94
- # voronoize(SUBJECT)
95
95
 
96
96
  let_there_be_light(context.scene)
97
97
 
98
- exec(open(os.path.join(path + '/glitch3d/bpy/canvas', 'dreamatorium.py')).read())
99
- # exec(open(os.path.join(path + '/glitch3d/bpy/canvas', 'aether.py')).read())
98
+ if debug == False:
99
+ exec(open(os.path.join(path + '/glitch3d/bpy/canvas', 'dreamatorium.py')).read())
100
+ # exec(open(os.path.join(path + '/glitch3d/bpy/canvas', 'aether.py')).read())
101
+
102
+ print('Rendering images with resolution: ' + str(context.scene.render.resolution_x) + ' x ' + str(context.scene.render.resolution_y))
100
103
 
101
- print('Rendering images with resolution: ' + str(context.scene.render.resolution_x) + ' x ' + str(context.scene.render.resolution_y))
104
+ for plane in bpy.data.groups['Plane'].objects:
105
+ unwrap_model(plane)
102
106
 
103
- for plane in bpy.data.groups['Plane'].objects:
104
- unwrap_model(plane)
107
+ if animate:
108
+ print('ANIMATION RENDERING BEGIN')
109
+ context.scene.frame_start = 0
110
+ context.scene.frame_end = NUMBER_OF_FRAMES
111
+ bpy.ops.screen.frame_jump(end=False)
112
+ CAMERA_PATH = camera_path(0.008)
105
113
 
106
- if animate:
107
- print('ANIMATION RENDERING BEGIN')
108
- context.scene.frame_start = 0
109
- context.scene.frame_end = NUMBER_OF_FRAMES
110
- bpy.ops.screen.frame_jump(end=False)
111
- CAMERA_PATH = camera_path(0.008)
114
+ for frame in range(0, NUMBER_OF_FRAMES):
115
+ bpy.context.scene.frame_set(frame)
116
+ animation_routine(frame - 1)
117
+ for obj in context.scene.objects:
118
+ obj.keyframe_insert(data_path="rotation_euler", index=-1)
119
+ obj.keyframe_insert(data_path="location", index=-1)
120
+ bpy.ops.screen.frame_jump(end=False)
121
+ shoot(output_name(model_path))
112
122
 
113
- for frame in range(0, NUMBER_OF_FRAMES):
114
- bpy.context.scene.frame_set(frame)
115
- animation_routine(frame - 1)
116
- for obj in context.scene.objects:
117
- obj.keyframe_insert(data_path="rotation_euler", index=-1)
118
- obj.keyframe_insert(data_path="location", index=-1)
119
- bpy.ops.screen.frame_jump(end=False)
120
- shoot(output_name(model_path))
123
+ else:
124
+ print('STILL RENDERING BEGIN')
125
+ for index in range(0, int(shots_number)):
126
+ print("-------------------------- " + str(index) + " --------------------------")
127
+ still_routine(index)
128
+ look_at(SUBJECT)
129
+ shoot(output_name(model_path, index))
121
130
 
122
- else:
123
- print('STILL RENDERING BEGIN')
124
- for index in range(0, int(shots_number)):
125
- print("-------------------------- " + str(index) + " --------------------------")
126
- still_routine(index)
127
- look_at(SUBJECT)
128
- shoot(output_name(model_path, index))
129
131
 
132
+ print('FINISHED ¯\_(ツ)_/¯')
130
133
 
131
- print('FINISHED ¯\_()_/¯')
134
+ shoot(output_name(model_path))
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Glitch3d
3
- VERSION = '0.2.2.9'
3
+ VERSION = '0.2.3.0'
4
4
  end
data/lib/glitch3d.rb CHANGED
@@ -44,6 +44,12 @@ module Glitch3d
44
44
  args['animate'] = 'false'
45
45
  end
46
46
 
47
+ if args.has_key?('debug')
48
+ args['debug'] = 'true'
49
+ else
50
+ args['debug'] = 'false'
51
+ end
52
+
47
53
  raise 'Set Blender executable path in your env variables before using glitch3d' if BLENDER_EXECUTABLE_PATH.nil?
48
54
  self.class.include infer_strategy(args['mode'] || 'default')
49
55
  @quality = args['quality'] || 'low'
@@ -170,7 +176,9 @@ module Glitch3d
170
176
  '-p',
171
177
  File.dirname(__FILE__).to_s,
172
178
  '-a',
173
- initial_args['animate'].capitalize
179
+ initial_args['animate'].capitalize,
180
+ '-d',
181
+ initial_args['debug'].capitalize
174
182
  ]
175
183
  system(*args)
176
184
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glitch3d
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2.9
4
+ version: 0.2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - pskl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-19 00:00:00.000000000 Z
11
+ date: 2017-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler