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
1f54dbcc
Commit
1f54dbcc
authored
Nov 22, 2019
by
Breno Rilho Lemos
💬
Browse files
Add stamp note to animation
parent
73e5ee64
Changes
2
Hide whitespace changes
Inline
Side-by-side
animate_particles.py
View file @
1f54dbcc
...
...
@@ -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=1 -camera="BarrelCamera" -datafile="esd-detail.dat" -simulated_t=0.02 -fps=24 -resolution=100
# $ blender -noaudio --background -P animate_particles.py -- -radius=0.05 -duration=1 -camera="BarrelCamera" -datafile="esd-detail.dat" -simulated_t=0.02 -fps=24 -resolution=100
-stamp_note="Texto no canto"
#
import
os
...
...
@@ -33,6 +33,7 @@ parser.add_argument('-datafile','--datafile')
parser
.
add_argument
(
'-simulated_t'
,
'--simulated_t'
)
parser
.
add_argument
(
'-fps'
,
'--fps'
)
parser
.
add_argument
(
'-resolution'
,
'--resolution_percent'
)
parser
.
add_argument
(
'-stamp_note'
,
'--stamp_note'
)
args
=
parser
.
parse_args
()
bpy
.
context
.
user_preferences
.
view
.
show_splash
=
False
...
...
@@ -56,19 +57,19 @@ renderCamera= args.render_camera
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
init
(
args
.
stamp_note
)
# Cleanup, addCameras, addALICE_TPC
particles
=
driver
.
getParticles
()
blender_particles
,
blender_tracks
=
createSceneParticles
(
particles
,
createTracks
=
True
)
# Create blender objects - one sphere per particle
...
...
scene_functions.py
View file @
1f54dbcc
def
init
():
def
init
(
unique_id
):
bcs
=
bpy
.
context
.
scene
# Configure Environment
bcs
.
world
.
light_settings
.
use_environment_light
=
False
bcs
.
world
.
light_settings
.
environment_energy
=
0.1
# Configure Stamp
bpy
.
context
.
scene
.
render
.
use_stamp
=
True
bpy
.
context
.
scene
.
render
.
use_stamp_time
=
False
bpy
.
context
.
scene
.
render
.
use_stamp_date
=
False
bpy
.
context
.
scene
.
render
.
use_stamp_render_time
=
False
bpy
.
context
.
scene
.
render
.
use_stamp_frame
=
False
bpy
.
context
.
scene
.
render
.
use_stamp_scene
=
False
bpy
.
context
.
scene
.
render
.
use_stamp_camera
=
False
bpy
.
context
.
scene
.
render
.
use_stamp_filename
=
False
bpy
.
context
.
scene
.
render
.
stamp_note_text
=
unique_id
bpy
.
context
.
scene
.
render
.
use_stamp_note
=
True
# Cleanup
bpy
.
data
.
objects
.
remove
(
bpy
.
data
.
objects
[
'Cube'
])
bpy
.
data
.
objects
.
remove
(
bpy
.
data
.
objects
[
'Camera'
])
...
...
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