Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ALICE-open-data
ALICE Blender animation
Commits
7a49c363
Commit
7a49c363
authored
Oct 25, 2019
by
Rafael Pezzi
Browse files
Adding overview Camera
parent
31255dd6
Changes
2
Hide whitespace changes
Inline
Side-by-side
animate_particles.py
View file @
7a49c363
...
...
@@ -37,7 +37,7 @@ particle_colors = {"Electron":clRed, "Pion":clGreen, "Muon":clBlue, "Proton":clM
r_part
=
0.05
# Event Multiplicity
n_particles
=
10
00
n_particles
=
5
00
# Configure Environment
bcs
=
bpy
.
context
.
scene
...
...
@@ -121,13 +121,19 @@ camera_forward.data.type = 'ORTHO'
camera_forward
.
data
.
ortho_scale
=
10
# OverviewCamera
bpy
.
ops
.
object
.
camera_add
(
location
=
(
6.98591
,
-
19.7115
,
23.9696
),
rotation
=
(
-
0.281366
,
0.683857
,
-
1.65684
))
bpy
.
context
.
object
.
name
=
"OverviewCamera"
bpy
.
context
.
object
.
data
.
lens
=
66.78
# Barrel Camera
bpy
.
ops
.
object
.
camera_add
(
location
=
(
6
,
0
,
0
),
rotation
=
(
0
,
1.5708
,
0
))
#bpy.context.object.rotation_euler[1] = 1.5708
bpy
.
context
.
object
.
name
=
"BarrelCamera"
# Select scene camera
bpy
.
context
.
scene
.
camera
=
bpy
.
data
.
objects
[
"
Forward
Camera"
]
bpy
.
context
.
scene
.
camera
=
bpy
.
data
.
objects
[
"
Overview
Camera"
]
# Create particles
particles
=
createNparticlesPropGaussian
(
n_particles
)
...
...
@@ -168,6 +174,6 @@ bpy.context.scene.frame_current = 20
#bpy.ops.wm.save_as_mainfile(filepath="/home/pezzi/particles_"+str(n_particles)+".blend")
# Render animation
bpy
.
ops
.
render
.
render
(
animation
=
True
)
#
bpy.ops.render.render(animation=True)
#exit()
particle.py
View file @
7a49c363
...
...
@@ -56,6 +56,6 @@ def createNparticlesPropGaussian(N_particles, x = 0, y = 0, z = 0): # Create pa
charge
=
random
.
choice
([
+
1
,
-
1
])
part
=
ParticlePropagator
(
i
,
x
,
y
,
z
)
part
.
SetMagneticField
()
part
.
SetProperties
(
random
.
gauss
(
0
,
4
),
random
.
gauss
(
0
,
4
),
random
.
gauss
(
0
,
4
),
charge
)
part
.
SetProperties
(
random
.
gauss
(
0
,
3
),
random
.
gauss
(
0
,
3
),
random
.
gauss
(
0
,
3
),
charge
)
particles
.
append
(
part
)
return
particles
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment