glitch3d 0.1.4 → 0.1.5
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/rendering.py +5 -11
- data/lib/glitch3d/version.rb +1 -1
- data/lib/glitch3d.rb +2 -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: 7f57298b4aeab0fdbe9cda58070adfcfd3434e99
|
4
|
+
data.tar.gz: 6f8de6fd6a1008f0e2fb2ebbc875f46001fb164f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27db3f9feb5996d4af8097082f28fe70cc4e5323c9c0376115d1632fa6970712ead7d473d25ccc4d2741a4e8b9b375a217718d4e4fcda6fc1fb91af67de49fdb
|
7
|
+
data.tar.gz: 40c612550e10395aa72e4c7ba4dcf0f15a768e6a96a33fb8b6c324338c01333bc0eabb00dcf24e23d6699ace9f4ee7f5bc10c69afef499bd5a2358f71c22755c
|
@@ -19,7 +19,8 @@ mode = args.mode
|
|
19
19
|
shots_number = int(args.shots_number)
|
20
20
|
|
21
21
|
context = bpy.context
|
22
|
-
|
22
|
+
fixtures_folder_path = str(args.path) + '/../fixtures/'
|
23
|
+
texture_folder_path = fixtures_folder_path + 'textures/'
|
23
24
|
|
24
25
|
# Scene
|
25
26
|
new_scene = bpy.data.scenes.new("Automated Render Scene")
|
@@ -43,10 +44,11 @@ if mode == 'high':
|
|
43
44
|
context.scene.render.resolution_percentage = 100
|
44
45
|
|
45
46
|
# Add background to world
|
46
|
-
world = bpy.data.worlds
|
47
|
+
world = bpy.data.worlds.new('A Brave New World')
|
47
48
|
world.use_nodes = True
|
48
49
|
world_node_tree = world.node_tree
|
49
50
|
world_node_tree.nodes['Background'].inputs[0].default_value = rand_color_vector()
|
51
|
+
context.scene.world = world
|
50
52
|
|
51
53
|
# Delete current objects
|
52
54
|
for index, obj in enumerate(bpy.data.objects):
|
@@ -58,7 +60,7 @@ bpy.ops.import_scene.obj(filepath = model_path, use_edges=True)
|
|
58
60
|
model_object = bpy.data.objects[0]
|
59
61
|
|
60
62
|
# Load props
|
61
|
-
bpy.ops.import_scene.obj(filepath = os.path.join('
|
63
|
+
bpy.ops.import_scene.obj(filepath = os.path.join(fixtures_folder_path + 'm4a1.obj'), use_edges=True)
|
62
64
|
m4a1 = bpy.data.objects['m4a1']
|
63
65
|
texture_object(m4a1)
|
64
66
|
m4a1.location = rand_location()
|
@@ -69,14 +71,6 @@ bpy.ops.mesh.primitive_cube_add(location=rand_location(),radius=rand_scale(), ro
|
|
69
71
|
cube = bpy.data.objects['Cube']
|
70
72
|
texture_object(cube)
|
71
73
|
|
72
|
-
bpy.ops.mesh.primitive_torus_add(location=rand_location(), rotation=rand_rotation(), major_radius=rand_scale(), minor_radius=rand_scale())
|
73
|
-
torus = bpy.data.objects['Torus']
|
74
|
-
texture_object(torus)
|
75
|
-
|
76
|
-
bpy.ops.mesh.primitive_cone_add(location=rand_location(), depth=1.0, rotation=rand_rotation(), radius1=rand_scale(), radius2=rand_scale())
|
77
|
-
cone = bpy.data.objects['Cone']
|
78
|
-
texture_object(cone)
|
79
|
-
|
80
74
|
# Use center of mass to center object
|
81
75
|
model_object.select = True
|
82
76
|
bpy.ops.object.origin_set(type="ORIGIN_CENTER_OF_MASS")
|
data/lib/glitch3d/version.rb
CHANGED
data/lib/glitch3d.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pskl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|