add blender call with stl auto import.
Signed-off-by: philippe lhardy <philippe@pavilionartlogiciel>
This commit is contained in:
67
doit.sh
67
doit.sh
@@ -128,6 +128,68 @@ edit_properties()
|
||||
|
||||
}
|
||||
|
||||
# first argument mandatory : directory containing generated .lab and .stl files ( usualy ./lab )
|
||||
list_labs()
|
||||
{
|
||||
local lab_dir=$1
|
||||
if [[ -d $lab_dir ]]
|
||||
then
|
||||
modified=0
|
||||
s=()
|
||||
properties=()
|
||||
values=()
|
||||
{
|
||||
pushd $lab_dir
|
||||
for stl_lab in $(ls *lab*.stl)
|
||||
do
|
||||
if [[ $stl_lab =~ ^([^0-9]*[0-9]*x[0-9]*).stl ]]
|
||||
then
|
||||
property=${BASH_REMATCH[1]}
|
||||
value=$stl_lab
|
||||
s+=("$property" "$value")
|
||||
properties+=("$property")
|
||||
values+=("$value")
|
||||
fi
|
||||
done
|
||||
s+=(exit "Exit")
|
||||
popd
|
||||
}
|
||||
|
||||
while true
|
||||
do
|
||||
property=$($DIALOG --menu "Show stl file from $lab_dir" 20 100 10 ${s[@]} 3>&1 1>&2 2>&3)
|
||||
if [[ $? = 0 ]]
|
||||
then
|
||||
if [[ -n $property ]]
|
||||
then
|
||||
if [[ $property == exit ]]
|
||||
then
|
||||
return 1
|
||||
elif [[ $property == save ]]
|
||||
then
|
||||
echo "TODO"
|
||||
return 0
|
||||
fi
|
||||
prop_len=${#properties[*]}
|
||||
for (( i=0; i<${prop_len}; i++ ));
|
||||
do
|
||||
if [[ ${properties[$i]} == $property ]]
|
||||
then
|
||||
blender --python blender_import.py -- $lab_dir/${values[$i]}
|
||||
fi
|
||||
done
|
||||
|
||||
fi
|
||||
else
|
||||
return 2
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "[ERROR] lab dir '$propertyfile' not found" >&2
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
possible_console_gui="whiptail dialog"
|
||||
|
||||
for DIALOG in $possible_console_gui
|
||||
@@ -151,7 +213,7 @@ action=initial
|
||||
|
||||
while [[ $action != quit ]]
|
||||
do
|
||||
action=$($DIALOG --menu "Ultra Light IDE" 20 80 12 run "Run it" clean "Clean All" ant "Ant build" test "Test it" readme "Read me" code "Code" codebg "Code in background" deb "Debian package" properties "Edit Properties" create "Create a new class" quit "Quit" 3>&1 1>&2 2>&3)
|
||||
action=$($DIALOG --menu "Ultra Light IDE" 20 80 12 readme "Read me" clean "Clean All" ant "Ant build" run "Run it" list_labs "Show Labyrinth with blender" test "Test it" code "Code" codebg "Code in background" deb "Debian package" properties "Edit Properties" create "Create a new class" quit "Quit" 3>&1 1>&2 2>&3)
|
||||
|
||||
if [[ $action == run ]]
|
||||
then
|
||||
@@ -198,5 +260,8 @@ do
|
||||
popd
|
||||
fi
|
||||
fi
|
||||
elif [[ $action == list_labs ]]
|
||||
then
|
||||
list_labs ./lab
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user