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 +4 -4
- data/lib/glitch3d/bpy/canvas/dreamatorium.py +1 -1
- data/lib/glitch3d/bpy/helpers.py +2 -3
- data/lib/glitch3d/bpy/main.py +32 -29
- data/lib/glitch3d/version.rb +1 -1
- data/lib/glitch3d.rb +9 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ce49988a7ab1cee9c39361b111a21bad4f1a1b1
|
4
|
+
data.tar.gz: 83db6ce2c18d0be3ea93da87076b9569a92850a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,
|
44
|
+
subdivide(floor, int(random.uniform(0, 7)))
|
45
45
|
displace(floor)
|
46
46
|
texture_object(floor)
|
47
47
|
|
data/lib/glitch3d/bpy/helpers.py
CHANGED
@@ -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
|
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
|
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)
|
data/lib/glitch3d/bpy/main.py
CHANGED
@@ -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
|
-
|
99
|
-
|
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
|
-
|
104
|
+
for plane in bpy.data.groups['Plane'].objects:
|
105
|
+
unwrap_model(plane)
|
102
106
|
|
103
|
-
|
104
|
-
|
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
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
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
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
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
|
-
|
134
|
+
shoot(output_name(model_path))
|
data/lib/glitch3d/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|