Welcome to Fractal Forums

Fractal Software => Mandelbulber => Topic started by: nameinuse2 on January 13, 2011, 10:40:56 AM




Title: Setting a parameter in all keyframes at once...
Post by: nameinuse2 on January 13, 2011, 10:40:56 AM
Here's a little bash/perl script that sets a parameter to the same value across all keyframes at once:

Code:
#!/bin/bash
#
# Quick and dirty script to set a mandelbulber parameter to
# the same value across all keyframe*.fract files in the current
# directory.
#
# Give the parameter name to search for as the first command line
# argument and the new value as the second command line argument.
# Note that replacement only happens if the parameter name is found
# followed by something that vaguely looks like a number, then a
# semicolon, but the replacement value is treated as straight text.
#
# Always make backups and use at your own risk!

if [ "$2" ]; then
perl -p -i -e "s/$1 [-e.0-9]+;/$1 $2;/g;" keyframe*.fract
# find $1 followed by digits, minus signs,
# exponential 'e's, decimal points then a semicolon -
# replace with just $1 $2 then a semicolon.
else
echo "usage: $0 parameter_name value"
echo "example: $0 DE_factor 0.2"
echo " will set DE_factor to 0.2 in all keyframe files."
fi

exit 0

I was getting a bit sick of setting up a bunch of keyframes, then having to go through them one by one after finding a better fog setting, or realising the resolution had been set really low the whole time.  Save this script as something like "setall.sh" in your .mandelbulber/keyframes directory, give it execute permission, and invoke it like

Code:
./setall.sh parameter_name new_value

Then it's all good!  Found the exact most aesthetically pleasing glow intensity at the end of a grueling dive?

Code:
./setall.sh glow_intensity 1.775

Bam!  Forgot you disabled shadows for speed but now you're at keyframe 181?

Code:
./setall.sh shadows_enabled 1

Blammo!

Say no to manual editing!


Title: Re: Setting a parameter in all keyframes at once...
Post by: bib on January 13, 2011, 10:47:34 AM
Say no to manual editing!

Say no to scripting, use Mandelbulb3D!
Just kidding ;)


Title: Re: Setting a parameter in all keyframes at once...
Post by: Buddhi on January 25, 2011, 07:56:58 PM
Here's a little bash/perl script that sets a parameter to the same value across all keyframes at once:

Thank you for this useful script. I have to add option like this directly in Mandelbulber, because I know how annoying is when there is needed to change the same parameter for all keyframes.