NOTE: this feature has only been tested under Windows,
but in theory it should work under Linux as well. At the time of writing this feature has not been touched or tested for some time - it might not work. If anyone finds a problem with it please get back to me so i can fix it up.
To export in background mode you need to put something like the
following in a .bat file:
@echo off
set chicken_sel=Object1;Object2
set chicken_anims=anim1,30,1,85;anim2,40,1,90
set chicken_bam=yes
set chicken_optchar=yes
set chicken_optparms=-inplace -flag Object1=group1 -flag Object2=group2
"c:\Program Files\Blender Foundation\Blender\blender.exe" -b
myblendfile.blend -P "c:\Program Files\Blender
Foundation\Blender\.blender\scripts\chicken_export1.0.py"
pause
Currently the most practical way to pass parameters to a Blender script
running in background mode is through environment variables. In version
1.0 there are 7 environment variables that are considered:
- CHICKEN_SEL: This defines your selection as a list
of object names separated by semicolons. If this variable is not
specified, the objects which were saved as selected will be used as the
selection.
- CHICKEN_ANIMS: This defines the animations you want
to export as a list of four values (name, fps, start_frame, end_frame)
separated by commas. Multiple animations can be specified by separating
them with semicolons.
- CHICKEN_BAM: If defined egg2bam is called on all
exported files. NOTE: the value is not checked, so you could do
something like 'set chicken_bam=no' and it would still invoke it. You
must unset it if you don't want it invoked. The same applies to
CHICKEN_OPTCHAR.
- CHICKEN_OPTCHAR: If defined egg-optchar is called
on all exported .egg files with the parameters in the CHICKEN_OPTPARMS
variable or '-inplace' in its absence.
- CHICKEN_OPTPARMS: Defines the parameters for
egg-optchar invocation.
- CHICKEN_MEXTRACT: Enables the Motion Extraction
feature.
- CHICKEN_ANIMONLY: Exports only the animation files.