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
9876ce1e
Commit
9876ce1e
authored
Nov 14, 2019
by
Breno Rilho Lemos
💬
Browse files
Add tracks to particle trajectories
parent
0b427002
Changes
2
Hide whitespace changes
Inline
Side-by-side
animate_particles.py
View file @
9876ce1e
...
...
@@ -2,7 +2,7 @@
# animate_particles.py - Animate HEP events
#
# For console only rendering (example):
# $ blender -noaudio --background -P animate_particles.py -- -radius
0.05 -duration
10
-camera
Overview
Camera -datafile
esd-detail.dat
# $ blender -noaudio --background -P animate_particles.py -- -radius
=
0.05 -duration
=1
-camera
="Barrel
Camera
"
-datafile
="
esd-detail.dat
"
#
import
os
...
...
@@ -50,20 +50,20 @@ fileIdentifier = "PhysicalTrajectories_"
## RenderCameras: ["ForwardCamera", "OverviewCamera", "BarrelCamera"]
renderCamera
=
args
.
render_camera
renderAnimation
=
False
#
True # True
renderAnimation
=
True
# True
saveBlenderFile
=
False
# False
"""
# Create and configure animation driver
n_particles
=
100
# Event Multiplicity
driver
=
genDriver
(
"GaussianGenerator"
,
n_particles
,
3.0
)
# Simple genDriver takes two parameters: number of particles and Gaussian width
driver
.
configure
(
renderCamera
,
duration
,
fps
,
simulated_t
,
outputPath
,
fileIdentifier
,
resolution_percent
)
"""
"""
# Create and configure animation driver
driver = dataDriver("AlirootFileGenerator",args.datafile) # Simple dataDriver takes one parameters: filename
driver.configure(renderCamera, duration, fps, simulated_t, outputPath, fileIdentifier, resolution_percent)
"""
### Build scene
init
()
# Cleanup, addCameras, addALICE_TPC
particles
=
driver
.
getParticles
()
...
...
scene_functions.py
View file @
9876ce1e
...
...
@@ -90,7 +90,7 @@ def createSceneParticles(particles, createTracks = False):
blender_tracks
=
[]
if
createTracks
:
for
track
in
particles
:
this_type
=
ra
ndom
.
choice
(
particle
_type
s
)
#TO DO: make this not random, but according to file data
this_type
=
t
ra
ck
.
p
_type
#TO DO: make this not random, but according to file data
print
(
"Adding Curve - Track "
+
str
(
len
(
blender_tracks
))
+
" of "
+
str
(
n_particles
-
1
)
+
" - "
+
this_type
)
# create the Curve Datablock
...
...
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