From: <pyr...@us...> - 2008-09-15 19:47:36
|
Revision: 12440 http://vegastrike.svn.sourceforge.net/vegastrike/?rev=12440&view=rev Author: pyramid3d Date: 2008-09-15 19:47:41 +0000 (Mon, 15 Sep 2008) Log Message: ----------- UnitConverter version 0.26: supports subunit and docking port helper meshes. editing of upgrades. Modified Paths: -------------- trunk/data/mission/modelview.mission trunk/data/units/units.csv trunk/modtools/UnitConverter/appwindow.py trunk/modtools/UnitConverter/objparse.py trunk/modtools/UnitConverter/unitconverter.py trunk/modtools/UnitConverter/vector.py trunk/modtools/UnitConverter/vsunitcsv.py Added Paths: ----------- trunk/modtools/UnitConverter/mount_helper.blend Modified: trunk/data/mission/modelview.mission =================================================================== --- trunk/data/mission/modelview.mission 2008-09-13 20:13:20 UTC (rev 12439) +++ trunk/data/mission/modelview.mission 2008-09-15 19:47:41 UTC (rev 12440) @@ -1,23 +1,23 @@ -<mission> - <settings> - <origin planet="earth" x="0000" y="100" z="000.0"/> - </settings> - - <variables> - <var name="credits" value="1350000"/> - <var name="defaultplayer" value="blue"/> - <var name="mission_name" value="Vega Strike Model viewer" /> - <var name="difficulty" value=".25"/><!--good starting difficulty here--> - <var name="system" value="Special/Modelview" /> - <var name="description" value="Welcome to Vega Strike: Upon the Cold Sea." /> - <var name="savegame" value="modelview" /> - </variables> - - <flightgroups> - <!-- need at least one, to avoid messing with the engine --> - <flightgroup name="Shlimazel" faction="privateer" type="Tridacna" ainame="default" waves="1" nr_ships="1"> - <pos x="119990000" y="-9000000" z="-1099900000"/> - </flightgroup> - </flightgroups> - -</mission> +<?xml version="1.0" ?><mission> + <settings> + <origin planet="earth" x="0000" y="100" z="000.0"/> + </settings> + + <variables> + <var name="credits" value="1350000"/> + <var name="defaultplayer" value="blue"/> + <var name="mission_name" value="Vega Strike Model viewer"/> + <var name="difficulty" value=".25"/><!--good starting difficulty here--> + <var name="system" value="Special/Modelview"/> + <var name="description" value="Welcome to Vega Strike: Upon the Cold Sea."/> + <var name="savegame" value="modelview"/> + </variables> + + <flightgroups> + <!-- need at least one, to avoid messing with the engine --> + <flightgroup ainame="default" faction="privateer" name="Shlimazel" nr_ships="2" type="Archimedes" waves="1"> + <pos x="1199900000" y="-9000000" z="-10999000000"/> + </flightgroup> + </flightgroups> + +</mission> \ No newline at end of file Modified: trunk/data/units/units.csv =================================================================== --- trunk/data/units/units.csv 2008-09-13 20:13:20 UTC (rev 12439) +++ trunk/data/units/units.csv 2008-09-15 19:47:41 UTC (rev 12440) @@ -30,7 +30,7 @@ Ancestor.shaperspec,./ancestor,Ancestor,MANEUVOUR,Vessel,FIGHTER,Shaper orbit-ground aerospace attack craft,ancestor-hud.spr,1,,0,1.8,8,{ancestor.bfxm;;},ancestor_shield.bfxm,,,,,,112,112,3.25,120,1,1,1,1,1,1,1,1,0,0,,,,,,,0,0,25,,,TRUE,1,,200,120,1,4,50000,50000,50000,55,55,55,18000,15000,9000,5000,5000,5000,5000,205,205,FALSE,FALSE,300000000,0,0,0,10,,,,,,,0,0,0,1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1,1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1,1,1,1,1,1,1,1,1,0,0,,,,mult_shady_moreupgrade:1;mult_shady_morethrust:1;mult_shady_moreshields:1;mult_shady_moregunrecharge:1;mult_shady_moreshieldrecharge:1;mult_shady_moreturning:1;upgrades/Overdrive:1;upgrades/Capacitors:1;upgrades/Reactors:1;upgrades/Armor:1;upgrades/Sensors:1;upgrades/Shield_Systems:1;upgrades/Passenger_Quarters:1;upgrades/Repair_Systems:1;upgrades/ECM_Systems:1,,;;;;;;,{thrust1.bfxm;0;.5;-7.5;8;;;;;}{thrust1.bfxm;1.3;0;-7.5;10;;;;;}{thrust1.bfxm;-1.3;0;-7.5;10;;;;;}{thrust1.bfxm;.4;-.3;-7;4;;;;;}{thrust1.bfxm;-.4;-.3;-7;4;;;;;},{;;5;Light Autotrack;1.75;1.5;-1;;;;;;;;;1;1}{;;5;Light Autotrack;-1.75;1.5;-1;;;;;;;;;1;1}{;;10;Light Medium;3.5;0;3.125;;;;;;;;;1;1}{;;10;Light Medium;-3.5;0;3.125;;;;;;;;;1;1}{;4;48;light-missile medium-missile;-2.500000;-0.200000;-2.00000;;;;;;;;;1;1}{;4;48;light-missile medium-missile;2.500000;-0.200000;-2.00000;;;;;;;;;1;1},,,,,,0,20,0,,,,,,pPiI Ancestor.stock,./ancestor,Ancestor,MANEUVOUR,Vessel,FIGHTER,Shaper orbit-ground aerospace attack craft,ancestor-hud.spr,1,,0,1.8,8,{ancestor.bfxm;;},ancestor_shield.bfxm,,,,,,66,66,3.25,120,1,1,1,1,1,1,1,1,75,75,,,,,,,4,0,325,100,15,FALSE,1,,200,120,1,4,50000,50000,50000,55,55,55,18000,15000,9000,5000,5000,5000,5000,205,205,FALSE,FALSE,300000000,4,180,25,10,,,,,,,0,0,0,1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1,1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1,1,1,1,1,1,1,1,1,0,0,,,,mult_shady_moreupgrade:1;mult_shady_morethrust:1;mult_shady_moreshields:1;mult_shady_moregunrecharge:1;mult_shady_moreshieldrecharge:1;mult_shady_moreturning:1;upgrades/Overdrive:1;upgrades/Capacitors:1;upgrades/Reactors:1;upgrades/Armor:1;upgrades/Sensors:1;upgrades/Shield_Systems:1;upgrades/Passenger_Quarters:1;upgrades/Repair_Systems:1;upgrades/ECM_Systems:1,,;;;;;;,{thrust1.bfxm;0;.5;-7.5;8;;;;;}{thrust1.bfxm;1.3;0;-7.5;10;;;;;}{thrust1.bfxm;-1.3;0;-7.5;10;;;;;}{thrust1.bfxm;.4;-.3;-7;4;;;;;}{thrust1.bfxm;-.4;-.3;-7;4;;;;;},{;;5;Light Autotrack;1.75;1.5;-1;;;;;;;;;1;1}{;;5;Light Autotrack;-1.75;1.5;-1;;;;;;;;;1;1}{;;10;Light Medium;3.5;0;3.125;;;;;;;;;1;1}{;;10;Light Medium;-3.5;0;3.125;;;;;;;;;1;1}{;4;48;light-missile medium-missile;-2.500000;-0.200000;-2.00000;;;;;;;;;1;1}{;4;48;light-missile medium-missile;2.500000;-0.200000;-2.00000;;;;;;;;;1;1},,,,{skyscope1;upgrades/Sensors/Basic;200;1;0.01;1;1;1;;0}{capacitor01;upgrades/Capacitors/Standard;200;1;2;2;1;1;;0}{reactor01;upgrades/Reactors/Standard;200;1;1;2;1;1;;0}{add_spec_capacitor01;upgrades/SPEC_Capacitors;200;1;5;4;1;1;;0}{dualshield01;upgrades/Shield_Systems/Standard_Dual_Shields;200;1;1;4;1;1;;0},,0,400,0,,,,,,pPiI -Archimedes,./Archimedes,Archimedes,,Vessel,CAPITAL,"Aging considerably, the Archimedes class remains formidable at long range, where it's arsenal of capital missiles of design more modern than itself maintain its martial standing with assistance from recent upgrades to the main battery of beam weapons and fully modern sensor equipment. However, limited time, resources, and fundamental design issues have meant that the rest of the ship shows the age of the design enough that the survivability of the craft is not as high as it once was, even if the offensive impact has increased.",archimedes-hud.sprite,1,,,,,{archimedes.bfxm;;},,,,,,,38400000,38400000,3820092.46,2210459,25000,25000,25000,25000,25000,25000,25000,25000,64000,64000,64000,64000,,,,,120,0,22000,100000,7000,TRUE,1,,20000,20000,1,16,10000000,10000000,10000000,3,3,4,250000000,180000000,140000000,10000000,10000000,10000000,10000000,25,25,TRUE,TRUE,300000000,24.49,180,84.26,200000000,,,,,,,0,0,0,1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1,1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1,1,1,1,1,1,1,1,1,0,0,,,,upgrades/Overdrive:1;upgrades/Shady_Mechanic,{turretLR_PminusBeam;-0.65;-101.44;-14.37;0.0;0.0;1.0;0.0;-1.0;0.0;180.0}{turretLR_PminusBeam;-0.65;101.6;-14.37;0.0;0.0;1.0;0.0;1.0;0.0;180.0}{turretcapmissile;2.644841;0.400000;-4.770843;1.000000;0.000000;0.000000;-0.000000;1.000000;0.000000;180.0}{turretcapmissile;2.187699;0.400000;-2.384122;0.129257;0.000000;0.991611;0.000000;1.000000;0.000000;180.0}{turretcapmissile;-3.073313;0.000000;-4.899379;-0.226708;0.000000;-0.973963;0.000000;-1.000000;-0.000000;180.0}{turretcapmissile;2.882210;0.000000;-4.341503;-0.226708;0.000000;0.973963;-0.000000;-1.000000;0.000000;180.0}{turretcapmissile;-1.312452;0.400000;5.613851;-0.315232;0.000000;0.949015;0.000000;1.000000;0.000000;180.0}{turretcapmissile;1.262048;0.600000;5.714783;0.793417;0.000000;-0.608679;0.000000;1.000000;0.000000;180.0}{turretpd;-2.381250;0.400000;-2.455606;0.226708;0.000000;0.973963;-0.000000;1.000000;0.000000;180.0}{turretpd;-3.243412;0.400000;-4.968820;-0.637206;0.000000;-0.770694;0.000000;1.000000;0.000000;180.0}{turretpd;2.644841;0.400000;-4.770843;1.000000;0.000000;0.000000;-0.000000;1.000000;0.000000;180.0}{turretpd;2.187699;0.400000;-2.384122;0.129257;0.000000;0.991611;0.000000;1.000000;0.000000;180.0}{turretpd;-3.073313;0.000000;-4.899379;-0.226708;0.000000;-0.973963;0.000000;-1.000000;-0.000000;180.0}{turretpd;2.882210;0.000000;-4.341503;-0.226708;0.000000;0.973963;-0.000000;-1.000000;0.000000;180.0}{turretpd;-1.312452;0.400000;5.613851;-0.315232;0.000000;0.949015;0.000000;1.000000;0.000000;180.0}{turretpd;1.262048;0.600000;5.714783;0.793417;0.000000;-0.608679;0.000000;1.000000;0.000000;180.0}{turretpd;-0.750000;0.800000;1.975000;1.000000;0.000000;0.000000;-0.000000;1.000000;0.000000;180.0}{turretpd;0.750000;0.800000;2.033626;0.000000;0.000000;1.000000;0.000000;1.000000;0.000000;180.0}{turretcapmissile;-0.000000;0.200000;13.616410;0.000000;0.000000;1.000000;0.000000;1.000000;0.000000;180.0}{turretcapmissile;-0.000000;0.000000;13.757195;-0.543227;0.000000;-0.839586;0.000000;-1.000000;0.000000;180.0}{turretbeamheavy;-0.000000;-0.200000;5.096140;-1.000000;0.000000;0.000000;-0.000000;-1.000000;0.000000;180.0}{turretbeamheavy;0.500000;-0.200000;7.500000;-0.597359;0.000000;0.801974;-0.000000;-1.000000;0.000000;180.0}{turretbeamheavy;-0.50000;-0.200000;7.500000;-0.597359;0.000000;0.801974;-0.000000;-1.000000;0.000000;180.0}{turretbeamheavy;-0.381250;0.800000;-6.455606;0.226708;0.000000;0.973963;-0.000000;1.000000;0.000000;180.0}{turretbeamheavy;0.381250;0.800000;-6.455606;0.226708;0.000000;0.973963;-0.000000;1.000000;0.000000;180.0},;;;;;;,{supernova.bmp.bfxm;-0.65;-0.0;-1260.76;100;;;;;}{supernova.bmp.bfxm;-219.38;-0.0;-996.0;100;;;;;}{supernova.bmp.bfxm;-150.35;-0.0;-996.0;100;;;;;}{supernova.bmp.bfxm;-80.64;-0.0;-996.0;100;;;;;}{supernova.bmp.bfxm;220.49;-0.0;-996.0;100;;;;;}{supernova.bmp.bfxm;151.14;-0.0;-996.0;100;;;;;}{supernova.bmp.bfxm;80.98;-0.0;-996.0;100;;;;;},,,{;.50;.45;9;.3;0}{;-.50;.45;9;.3;0},{Consumer_and_Commercial_Goods/Domestic;.9;.2;1;2}{Consumer_and_Commercial_Goods/Electronics;1.2;.2;1;4}{Contraband;;;;}{Industrially_Manufactured_Goods/Agricultural;.8;.1;;}{Industrially_Manufactured_Goods/Construction;.8;.2;;3}{Industrially_Manufactured_Goods/Electronics;.8;.2;;1}{Industrially_Manufactured_Goods/Manufacturing;.8;.1;1;3}{Industrially_Manufactured_Goods/Mining;.8;.1;;}{Industrially_Manufactured_Goods/Power_Utilities;1.2;.1;3;4}{Industrially_Manufactured_Goods/Recycled_Products;.78;.2;10;15}{Natural_Products/Food;1.2;.2;5;2}{Natural_Products/Life-forms;.9;.1;;}{Natural_Products/Liquor;1.05;.1;;1}{Natural_Products/Renewable_Resources;.8;.1;;}{Raw_Materials/Gases;1.1;.1;1;1}{Raw_Materials/Hydrocarbons;.8;.1;;}{Raw_Materials/Industrial_Gems;.8;.1;;}{Raw_Materials/Metals;.8;.1;;}{Raw_Materials/Stone;.8;.1;;}{Refined_Materials/Alloys;1.1;.1;;2}{Refined_Materials/Chemicals;1.1;.3;1;1}{Refined_Materials/Precious_Metals;.8;.1;;}{Refined_Materials/Purified_and_Enhanced_Materials;.8;.1;;}{Refined_Materials/Radioactive_Metals;.8;.1;;}{Specialty_Goods/Entertainment;1.1;.2;;4}{Specialty_Goods/Medical;1.1;.1;;3}{starships/Confed/Heavy;1;;-2;5}{starships/Confed/Light;1;;;3}{starships/Confed/Medium;1;;-3;9}{starships/Confed/Milspec;1;;-3;5}{starships/Regional_Guard/Heavy;1;;-2;3}{starships/Regional_Guard/Light;1;;;2}{starships/Regional_Guard/Medium;1;;;2}{upgrades/Ammunition/Confed;1;.1;-20;50}{upgrades/Armor;1;.1;;5}{upgrades/ECM_Systems;1;.1;;5}{upgrades/Experimental;1.4;.2;-20;23}{upgrades/Jump_Drives;1;.1;;5}{upgrades/Overdrive;1;.1;;5}{upgrades/Reactors/Standard;1;;;17}{upgrades/Repair_Systems;1.1;.2;;5}{upgrades/Sensors/Advanced;1;.1;;1}{upgrades/Sensors/Basic;1;;;5}{upgrades/Sensors/Intermediate;1;.1;;2}{upgrades/Shield_Systems/Standard_Dual_Shields;1;;;5}{upgrades/Shield_Systems/Standard_Quad_Shields;1;.1;-2;5}{upgrades/SPEC_Capacitors;1;.1;4;2}{upgrades/Weapons/Beam_Arrays_Confed_Milspec;1;.1;;5}{upgrades/Weapons/Beam_Arrays_Heavy;1;.1;;1}{upgrades/Weapons/Beam_Arrays_Light;1;;;5}{upgrades/Weapons/Beam_Arrays_Medium;1;.1;;2}{upgrades/Weapons/Mount_Enhancements;1;.1;;5}{upgrades/Weapons/Mounted_Guns_Confed_Milspec;1;.1;;2}{upgrades/Weapons/Mounted_Guns_Heavy;1;.1;;3}{upgrades/Weapons/Mounted_Guns_Light;1;;;10}{upgrades/Weapons/Mounted_Guns_Medium;1;;;5}{upgrades/Weapons/Turrets;1;.1;1;1},,,0,100000,0,,,,,,pPiI +Archimedes,./Archimedes,Archimedes,,Vessel,CAPITAL,"Aging considerably, the Archimedes class remains formidable at long range, where it's arsenal of capital missiles of design more modern than itself maintain its martial standing with assistance from recent upgrades to the main battery of beam weapons and fully modern sensor equipment. However, limited time, resources, and fundamental design issues have meant that the rest of the ship shows the age of the design enough that the survivability of the craft is not as high as it once was, even if the offensive impact has increased.",archimedes-hud.sprite,1,,,,,{archimedes.bfxm;;},,,,,,,38400000,38400000,3820092.46,2210459,25000,25000,25000,25000,25000,25000,25000,25000,64000,64000,64000,64000,,,,,120,0,22000,100000,7000,TRUE,1,,20000,20000,1,16,10000000,10000000,10000000,3,3,4,250000000,180000000,140000000,10000000,10000000,10000000,10000000,25,25,TRUE,TRUE,300000000,24.49,180,84.26,200000000,,,,,,,0,0,0,1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1,1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1,1,1,1,1,1,1,1,1,0,0,,,,upgrades/Overdrive:1;upgrades/Shady_Mechanic,{turretLR_PminusBeam;-0.65;-101.44;-14.37;0.0;0.0;1.0;0.0;-1.0;0.0;180.0}{turretLR_PminusBeam;-0.65;101.6;-14.37;0.0;0.0;1.0;0.0;1.0;0.0;180.0}{turretcapmissile;2.644841;0.400000;-4.770843;1.000000;0.000000;0.000000;-0.000000;1.000000;0.000000;180.0}{turretcapmissile;2.187699;0.400000;-2.384122;0.129257;0.000000;0.991611;0.000000;1.000000;0.000000;180.0}{turretcapmissile;-3.073313;0.000000;-4.899379;-0.226708;0.000000;-0.973963;0.000000;-1.000000;-0.000000;180.0}{turretcapmissile;2.882210;0.000000;-4.341503;-0.226708;0.000000;0.973963;-0.000000;-1.000000;0.000000;180.0}{turretcapmissile;-1.312452;0.400000;5.613851;-0.315232;0.000000;0.949015;0.000000;1.000000;0.000000;180.0}{turretcapmissile;1.262048;0.600000;5.714783;0.793417;0.000000;-0.608679;0.000000;1.000000;0.000000;180.0}{turretpd;-2.381250;0.400000;-2.455606;0.226708;0.000000;0.973963;-0.000000;1.000000;0.000000;180.0}{turretpd;-3.243412;0.400000;-4.968820;-0.637206;0.000000;-0.770694;0.000000;1.000000;0.000000;180.0}{turretpd;2.644841;0.400000;-4.770843;1.000000;0.000000;0.000000;-0.000000;1.000000;0.000000;180.0}{turretpd;2.187699;0.400000;-2.384122;0.129257;0.000000;0.991611;0.000000;1.000000;0.000000;180.0}{turretpd;-3.073313;0.000000;-4.899379;-0.226708;0.000000;-0.973963;0.000000;-1.000000;-0.000000;180.0}{turretpd;2.882210;0.000000;-4.341503;-0.226708;0.000000;0.973963;-0.000000;-1.000000;0.000000;180.0}{turretpd;-1.312452;0.400000;5.613851;-0.315232;0.000000;0.949015;0.000000;1.000000;0.000000;180.0}{turretpd;1.262048;0.600000;5.714783;0.793417;0.000000;-0.608679;0.000000;1.000000;0.000000;180.0}{turretpd;-0.750000;0.800000;1.975000;1.000000;0.000000;0.000000;-0.000000;1.000000;0.000000;180.0}{turretpd;0.750000;0.800000;2.033626;0.000000;0.000000;1.000000;0.000000;1.000000;0.000000;180.0}{turretcapmissile;-0.000000;0.200000;13.616410;0.000000;0.000000;1.000000;0.000000;1.000000;0.000000;180.0}{turretcapmissile;-0.000000;0.000000;13.757195;-0.543227;0.000000;-0.839586;0.000000;-1.000000;0.000000;180.0}{turretbeamheavy;-0.000000;-0.200000;5.096140;-1.000000;0.000000;0.000000;-0.000000;-1.000000;0.000000;180.0}{turretbeamheavy;0.500000;-0.200000;7.500000;-0.597359;0.000000;0.801974;-0.000000;-1.000000;0.000000;180.0}{turretbeamheavy;-0.50000;-0.200000;7.500000;-0.597359;0.000000;0.801974;-0.000000;-1.000000;0.000000;180.0}{turretbeamheavy;-0.381250;0.800000;-6.455606;0.226708;0.000000;0.973963;-0.000000;1.000000;0.000000;180.0}{turretbeamheavy;0.381250;0.800000;-6.455606;0.226708;0.000000;0.973963;-0.000000;1.000000;0.000000;180.0},;;;;;;,{supernova.bmp.bfxm;-0.65;-0.0;-1260.76;100;;;;;}{supernova.bmp.bfxm;-219.38;-0.0;-996.0;100;;;;;}{supernova.bmp.bfxm;-150.35;-0.0;-996.0;100;;;;;}{supernova.bmp.bfxm;-80.64;-0.0;-996.0;100;;;;;}{supernova.bmp.bfxm;220.49;-0.0;-996.0;100;;;;;}{supernova.bmp.bfxm;151.14;-0.0;-996.0;100;;;;;}{supernova.bmp.bfxm;80.98;-0.0;-996.0;100;;;;;},,,{;264.81;-0.0;-698.71;57.69;0}{;-264.17;-0.0;-698.71;57.69;0},{Consumer_and_Commercial_Goods/Domestic;.9;.2;1;2}{Consumer_and_Commercial_Goods/Electronics;1.2;.2;1;4}{Contraband;;;;}{Industrially_Manufactured_Goods/Agricultural;.8;.1;;}{Industrially_Manufactured_Goods/Construction;.8;.2;;3}{Industrially_Manufactured_Goods/Electronics;.8;.2;;1}{Industrially_Manufactured_Goods/Manufacturing;.8;.1;1;3}{Industrially_Manufactured_Goods/Mining;.8;.1;;}{Industrially_Manufactured_Goods/Power_Utilities;1.2;.1;3;4}{Industrially_Manufactured_Goods/Recycled_Products;.78;.2;10;15}{Natural_Products/Food;1.2;.2;5;2}{Natural_Products/Life-forms;.9;.1;;}{Natural_Products/Liquor;1.05;.1;;1}{Natural_Products/Renewable_Resources;.8;.1;;}{Raw_Materials/Gases;1.1;.1;1;1}{Raw_Materials/Hydrocarbons;.8;.1;;}{Raw_Materials/Industrial_Gems;.8;.1;;}{Raw_Materials/Metals;.8;.1;;}{Raw_Materials/Stone;.8;.1;;}{Refined_Materials/Alloys;1.1;.1;;2}{Refined_Materials/Chemicals;1.1;.3;1;1}{Refined_Materials/Precious_Metals;.8;.1;;}{Refined_Materials/Purified_and_Enhanced_Materials;.8;.1;;}{Refined_Materials/Radioactive_Metals;.8;.1;;}{Specialty_Goods/Entertainment;1.1;.2;;4}{Specialty_Goods/Medical;1.1;.1;;3}{starships/Confed/Heavy;1;;-2;5}{starships/Confed/Light;1;;;3}{starships/Confed/Medium;1;;-3;9}{starships/Confed/Milspec;1;;-3;5}{starships/Regional_Guard/Heavy;1;;-2;3}{starships/Regional_Guard/Light;1;;;2}{starships/Regional_Guard/Medium;1;;;2}{upgrades/Ammunition/Confed;1;.1;-20;50}{upgrades/Armor;1;.1;;5}{upgrades/ECM_Systems;1;.1;;5}{upgrades/Experimental;1.4;.2;-20;23}{upgrades/Jump_Drives;1;.1;;5}{upgrades/Overdrive;1;.1;;5}{upgrades/Reactors/Standard;1;;;17}{upgrades/Repair_Systems;1.1;.2;;5}{upgrades/Sensors/Advanced;1;.1;;1}{upgrades/Sensors/Basic;1;;;5}{upgrades/Sensors/Intermediate;1;.1;;2}{upgrades/Shield_Systems/Standard_Dual_Shields;1;;;5}{upgrades/Shield_Systems/Standard_Quad_Shields;1;.1;-2;5}{upgrades/SPEC_Capacitors;1;.1;4;2}{upgrades/Weapons/Beam_Arrays_Confed_Milspec;1;.1;;5}{upgrades/Weapons/Beam_Arrays_Heavy;1;.1;;1}{upgrades/Weapons/Beam_Arrays_Light;1;;;5}{upgrades/Weapons/Beam_Arrays_Medium;1;.1;;2}{upgrades/Weapons/Mount_Enhancements;1;.1;;5}{upgrades/Weapons/Mounted_Guns_Confed_Milspec;1;.1;;2}{upgrades/Weapons/Mounted_Guns_Heavy;1;.1;;3}{upgrades/Weapons/Mounted_Guns_Light;1;;;10}{upgrades/Weapons/Mounted_Guns_Medium;1;;;5}{upgrades/Weapons/Turrets;1;.1;1;1},,,0,100000,0,,,,,,pPiI Archimedes.blank,./Archimedes,Archimedes,,Vessel,CAPITAL,"Aging considerably, the Archimedes class remains formidable at long range, where it's arsenal of capital missiles of design more modern than itself maintain its martial standing with assistance from recent upgrades to the main battery of beam weapons and fully modern sensor equipment. However, limited time, resources, and fundamental design issues have meant that the rest of the ship shows the age of the design enough that the survivability of the craft is not as high as it once was, even if the offensive impact has increased.",archimedes-hud.sprite,96,,,,,{archimedes.bfxm;;},,,,,,,38400000,38400000,3820092.46,2210459,12500,12500,12500,12500,12500,12500,12500,12500,42000,42000,42000,42000,,,,,120,0,22000,100000,7000,TRUE,1,,20000,20000,1,16,10000000,10000000,10000000,3,3,4,250000000,180000000,140000000,10000000,10000000,10000000,10000000,25,25,TRUE,TRUE,300000000,24.49,180,84.26,20000000,,,,,,,0,0,0,1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1,1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1,1,1,1,1,1,1,1,1,0,0,,,,upgrades/Overdrive:1;upgrades/Shady_Mechanic,{turretcapmissile;-2.381250;0.400000;-2.455606;0.226708;0.000000;0.973963;-0.000000;1.000000;0.000000;180.0}{turretcapmissile;-3.243412;0.400000;-4.968820;-0.637206;0.000000;-0.770694;0.000000;1.000000;0.000000;180.0}{turretcapmissile;2.644841;0.400000;-4.770843;1.000000;0.000000;0.000000;-0.000000;1.000000;0.000000;180.0}{turretcapmissile;2.187699;0.400000;-2.384122;0.129257;0.000000;0.991611;0.000000;1.000000;0.000000;180.0}{turretcapmissile;-3.073313;0.000000;-4.899379;-0.226708;0.000000;-0.973963;0.000000;-1.000000;-0.000000;180.0}{turretcapmissile;2.882210;0.000000;-4.341503;-0.226708;0.000000;0.973963;-0.000000;-1.000000;0.000000;180.0}{turretcapmissile;-1.312452;0.400000;5.613851;-0.315232;0.000000;0.949015;0.000000;1.000000;0.000000;180.0}{turretcapmissile;1.262048;0.600000;5.714783;0.793417;0.000000;-0.608679;0.000000;1.000000;0.000000;180.0}{turretpd;-2.381250;0.400000;-2.455606;0.226708;0.000000;0.973963;-0.000000;1.000000;0.000000;180.0}{turretpd;-3.243412;0.400000;-4.968820;-0.637206;0.000000;-0.770694;0.000000;1.000000;0.000000;180.0}{turretpd;2.644841;0.400000;-4.770843;1.000000;0.000000;0.000000;-0.000000;1.000000;0.000000;180.0}{turretpd;2.187699;0.400000;-2.384122;0.129257;0.000000;0.991611;0.000000;1.000000;0.000000;180.0}{turretpd;-3.073313;0.000000;-4.899379;-0.226708;0.000000;-0.973963;0.000000;-1.000000;-0.000000;180.0}{turretpd;2.882210;0.000000;-4.341503;-0.226708;0.000000;0.973963;-0.000000;-1.000000;0.000000;180.0}{turretpd;-1.312452;0.400000;5.613851;-0.315232;0.000000;0.949015;0.000000;1.000000;0.000000;180.0}{turretpd;1.262048;0.600000;5.714783;0.793417;0.000000;-0.608679;0.000000;1.000000;0.000000;180.0}{turretpd;-0.750000;0.800000;1.975000;1.000000;0.000000;0.000000;-0.000000;1.000000;0.000000;180.0}{turretpd;0.750000;0.800000;2.033626;0.000000;0.000000;1.000000;0.000000;1.000000;0.000000;180.0}{turretLR_PminusBeam;-0.000000;0.200000;13.616410;0.000000;0.000000;1.000000;0.000000;1.000000;0.000000;180.0}{turretLR_PminusBeam;-0.000000;0.000000;13.757195;-0.543227;0.000000;-0.839586;0.000000;-1.000000;0.000000;180.0}{turretbeamheavy;-0.000000;-0.200000;5.096140;-1.000000;0.000000;0.000000;-0.000000;-1.000000;0.000000;180.0}{turretbeamheavy;0.500000;-0.200000;7.500000;-0.597359;0.000000;0.801974;-0.000000;-1.000000;0.000000;180.0}{turretbeamheavy;-0.50000;-0.200000;7.500000;-0.597359;0.000000;0.801974;-0.000000;-1.000000;0.000000;180.0}{turretbeamheavy;-0.381250;0.800000;-6.455606;0.226708;0.000000;0.973963;-0.000000;1.000000;0.000000;180.0}{turretbeamheavy;0.381250;0.800000;-6.455606;0.226708;0.000000;0.973963;-0.000000;1.000000;0.000000;180.0},;;;;;;,{supernova.bmp.bfxm;-0.007512;0.108995;-13.162303;0.420000;;;;;}{supernova.bmp.bfxm;-1.298644;0.250378;-9.955322;0.739999;;;;;}{supernova.bmp.bfxm;-2.182528;0.257965;-9.449021;0.779999;;;;;}{supernova.bmp.bfxm;-2.919419;0.241751;-9.026920;0.779999;;;;;}{supernova.bmp.bfxm;1.947601;0.169290;-9.583591;0.690000;;;;;}{supernova.bmp.bfxm;1.252088;0.181478;-9.981990;0.680000;;;;;}{supernova.bmp.bfxm;2.731254;0.138757;-9.134703;0.530000;;;;;},,,{;.50;.45;9;.3;0}{;-.50;.45;9;.3;0},,,,0,100000,0,,,,,,pPiI Areus,./Areus,Areus,,Vessel,BOMBER,Aeran assault craft (fighter bomber),areus-hud.spr,1.25,light_cockpit.cpt,,,16,{areus.bfxm;;},,,,,,,216,216,18,450,400,400,400,400,300,300,300,300,1600,1600,1600,1600,,,,,40,0,1600,1200,240,TRUE,1,,200,200,1,4,24000,24000,50000,70,75,70,21600,15000,10000,4000,4000,4000,4000,275,275,TRUE,TRUE,300000000,10,180,10,50,,,,,,,0,0,0,1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1,1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1,1,1,1,1,1,1,1,1,0,0,,,,mult_shady_moreupgrade;mult_shady_morethrust;mult_shady_moreshields;mult_shady_moregunrecharge;mult_shady_moreshieldrecharge;mult_shady_moreturning;upgrades/Overdrive:1;upgrades/Capacitors:1;upgrades/Reactors:1;upgrades/Armor:1;upgrades/Sensors:1;upgrades/Shield_Systems:1;upgrades/Passenger_Quarters:1;upgrades/Repair_Systems:1;upgrades/ECM_Systems:1,,;;;;;;,{aeraburn.bfxm;-1;5.125;-11.25;8;;;;;}{aeraburn.bfxm;1;5.125;-11.25;8;;;;;}{aeraburn.bfxm;-1;-3;-11.25;8;;;;;}{aeraburn.bfxm;1;-3;-11.25;8;;;;;},{Photon_MKIII;3000;6;Light medium autotracking;6;-2.75;-4.75;;;;;;;;;1;1}{Photon_MKIII;3000;6;Light medium autotracking;-6;-2.75;-4.75;;;;;;;;;1;1}{Photon_MKIII;3000;6;Light medium autotracking;6;4.75;-4.75;;;;;;;;;1;1}{Photon_MKIII;3000;6;Light medium autotracking;-6;4.75;-4.75;;;;;;;;;1;1}{Penetrator;;40;heavy autotracking;0;-3;3;;;;;;;;;1;1}{Heatseeker;7;21;light-missile;6.082913;-.368988;0.747223;;;;;;;;;1;1}{HeatSeeker;7;21;light-missile;-6.157103;-.379586;1.100964;;;;;;;;;1;1}{AdvTorpedo;4;400;Light-missile medium-missile heavy-missile;6.045031;-3.217878;0.973509;;;;;;;;;1;1}{AdvTorpedo;4;400;Light-missile medium-missile heavy-missile;-6.022359;-3.201684;0.913285;;;;;;;;;1;1},,,,,explosion_aera.ani,0,900,0,,,,,,pPiI Modified: trunk/modtools/UnitConverter/appwindow.py =================================================================== --- trunk/modtools/UnitConverter/appwindow.py 2008-09-13 20:13:20 UTC (rev 12439) +++ trunk/modtools/UnitConverter/appwindow.py 2008-09-15 19:47:41 UTC (rev 12440) @@ -11,7 +11,7 @@ # # Description: Provides a frame widget with menu button # Author: pyramid -# Version: 2008-09-03 | v0.15 +# Version: 2008-09-14 | v0.25 # Contact: py...@sa... #--------------------------------------------------------------------------------- @@ -21,46 +21,184 @@ # receives master widget reference and orientation def __init__(self, master, side=LEFT): - self.activeframe = None - self.count = 0 - self.choice = IntVar(0) - # allows the TOP and BOTTOM - # radiobuttons' positioning. - if side in (TOP, BOTTOM): - self.side = LEFT - else: - self.side = TOP - # creates window frame structure - self.rb_fr = Frame(master, borderwidth=2, relief=RIDGE, bg="#BFB8FE") - self.rb_fr.pack(side=side, fill=BOTH) - self.screen_fr = Frame(master, borderwidth=2, relief=RIDGE, bg="#BFB8FE") - self.screen_fr.pack(fill=BOTH) - + self.activeframe = None + self.count = 0 + self.choice = IntVar(0) + # allows the TOP and BOTTOM + # radiobuttons' positioning. + if side in (TOP, BOTTOM): + self.side = LEFT + else: + self.side = TOP + # creates window frame structure + self.rb_fr = Frame(master, borderwidth=2, relief=RIDGE, bg="#BFB8FE") + #self.rb_fr = AppFrame(master, borderwidth=2, relief=RIDGE, bg="#BFB8FE") + #self.rb_fr = AppWinFrame(master) + self.rb_fr.pack(side=side, fill=BOTH) + self.screen_fr = Frame(master, borderwidth=2, relief=RIDGE, bg="#BFB8FE") + #self.screen_fr = AppFrame(master) + self.screen_fr.pack(fill=BOTH) + # return a master frame reference for the external frames (screens) def __call__(self): return self.screen_fr # add a new frame (screen) to the (bottom/left of the) window def add_screen(self, fr, title): - b = Radiobutton(self.rb_fr, text=title, indicatoron=0, \ - variable=self.choice, value=self.count, \ - command=lambda: self.display(fr)) - b.pack(fill=BOTH, side=self.side) - # ensures the first frame will be - # the first selected/enabled - if not self.activeframe: - fr.pack(fill=BOTH, expand=1) - self.activeframe = fr - self.count += 1 - # returns a reference to the newly created - # radiobutton (allowing its configuration/destruction) - return b + b = Radiobutton(self.rb_fr, text=title, indicatoron=0, \ + variable=self.choice, value=self.count, \ + command=lambda: self.display(fr)) + b.pack(fill=BOTH, side=self.side) + # ensures the first frame will be + # the first selected/enabled + if not self.activeframe: + fr.pack(fill=BOTH, expand=1) + self.activeframe = fr + self.count += 1 + # returns a reference to the newly created + # radiobutton (allowing its configuration/destruction) + return b # hides the former active frame and shows # another one, keeping its reference def display(self, fr): - self.activeframe.forget() - fr.pack(fill=BOTH, expand=1) - self.activeframe = fr + self.activeframe.forget() + fr.pack(fill=BOTH, expand=1) + #fr.update_idletasks() + #fr.config(scrollregion=fr.bbox("all")) + self.activeframe = fr -# EOF +class AutoScrollbar(Scrollbar): + # a scrollbar that hides itself if it's not needed. only + # works if you use the grid geometry manager. + def set(self, lo, hi): + if float(lo) <= 0.0 and float(hi) >= 1.0: + # grid_remove is currently missing from Tkinter! + self.tk.call("grid", "remove", self) + else: + self.grid() + Scrollbar.set(self, lo, hi) + def pack(self, **kw): + raise TclError, "cannot use pack with this widget" + def place(self, **kw): + raise TclError, "cannot use place with this widget" + +def AppWinFrame(master): + # auto scrolls + """ + vscrollbar = Scrollbar(master) + vscrollbar.grid(row=0, column=1, sticky=N+S) + hscrollbar = Scrollbar(master, orient=HORIZONTAL) + hscrollbar.grid(row=1, column=0, sticky=E+W) + canvas = Canvas(master, + yscrollcommand=vscrollbar.set, + xscrollcommand=hscrollbar.set, bg='#999999') + #canvas.grid(row=0, column=0, sticky=N+S+E+W) + #vscrollbar.config(command=canvas.yview) + #hscrollbar.config(command=canvas.xview) + # make the canvas expandable + #master.grid_rowconfigure(0, weight=1) + #master.grid_columnconfigure(0, weight=1) + frame = Frame(canvas) + #frame.rowconfigure(1, weight=1) + #frame.columnconfigure(1, weight=1) + #canvas.create_window(0, 0, anchor=NW, window=frame) + #frame.update_idletasks() + #canvas.config(scrollregion=canvas.bbox("all")) + """ + vscrollbar = Scrollbar(master) + vscrollbar.pack(side=RIGHT, fill=Y) + canvas = Canvas(master, yscrollcommand=vscrollbar.set, bg='#999999') + frame = Frame(canvas, borderwidth=2, relief=RIDGE, bg="#BFB8FE") + vscrollbar.config(command=canvas.yview) + frame.pack(side=LEFT, fill=BOTH) + #frame.update_idletasks() + #canvas.config(scrollregion=canvas.bbox("all")) + #frame = Frame(master) + return canvas + +class Test(Frame): + def printit(self): + print "hi" + + def createWidgets(self): + self.question = Label(self, text="Can Find The BLUE Square??????") + self.question.pack() + + #self.QUIT = Button(self, text='QUIT', background='red', + #height=3, command=self.quit) + #self.QUIT.pack(side=BOTTOM, fill=BOTH) + #spacer = Frame(self, height="0.25i") + #spacer.pack(side=BOTTOM) + + # notice that the scroll region (20" x 20") is larger than + # displayed size of the widget (5" x 5") + self.draw = Canvas(self, width="5i", height="5i", + background="white", + scrollregion=(0, 0, "20i", "20i")) + + self.draw.scrollX = Scrollbar(self, orient=HORIZONTAL) + self.draw.scrollY = Scrollbar(self, orient=VERTICAL) + + # now tie the three together. This is standard boilerplate text + self.draw['xscrollcommand'] = self.draw.scrollX.set + self.draw['yscrollcommand'] = self.draw.scrollY.set + self.draw.scrollX['command'] = self.draw.xview + self.draw.scrollY['command'] = self.draw.yview + + # draw something. Note that the first square + # is visible, but you need to scroll to see the second one. + self.draw.create_rectangle(0, 0, "3.5i", "3.5i", fill="black") + self.draw.create_rectangle("10i", "10i", "13.5i", "13.5i", fill="blue") + # pack 'em up + self.draw.scrollX.pack(side=BOTTOM, fill=X) + self.draw.scrollY.pack(side=RIGHT, fill=Y) + self.draw.pack(side=LEFT) + return self.draw + + def scrollCanvasX(self, *args): + print "scrolling", args + print self.draw.scrollX.get() + + def __init__(self, master=None): + Frame.__init__(self, master) + Pack.config(self) + self.createWidgets() + +def AppFrame(master): + question = Label(master, text="Can Find The BLUE Square??????") + question.pack() + + #self.QUIT = Button(self, text='QUIT', background='red', + #height=3, command=self.quit) + #self.QUIT.pack(side=BOTTOM, fill=BOTH) + #spacer = Frame(self, height="0.25i") + #spacer.pack(side=BOTTOM) + + # notice that the scroll region (20" x 20") is larger than + # displayed size of the widget (5" x 5") + draw = Canvas(master, width="5i", height="5i", + background="white", + scrollregion=(0, 0, "20i", "20i")) + frame = Frame(draw) + + draw.scrollX = Scrollbar(master, orient=HORIZONTAL) + draw.scrollY = Scrollbar(master, orient=VERTICAL) + + # now tie the three together. This is standard boilerplate text + draw['xscrollcommand'] = draw.scrollX.set + draw['yscrollcommand'] = draw.scrollY.set + draw.scrollX['command'] = draw.xview + draw.scrollY['command'] = draw.yview + + # draw something. Note that the first square + # is visible, but you need to scroll to see the second one. + draw.create_rectangle(0, 0, "3.5i", "3.5i", fill="black") + draw.create_rectangle("10i", "10i", "13.5i", "13.5i", fill="blue") + # pack 'em up + draw.scrollX.pack(side=BOTTOM, fill=X) + draw.scrollY.pack(side=RIGHT, fill=Y) + draw.pack(side=LEFT) + return draw + +#EOF \ No newline at end of file Property changes on: trunk/modtools/UnitConverter/mount_helper.blend ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Modified: trunk/modtools/UnitConverter/objparse.py =================================================================== --- trunk/modtools/UnitConverter/objparse.py 2008-09-13 20:13:20 UTC (rev 12439) +++ trunk/modtools/UnitConverter/objparse.py 2008-09-15 19:47:41 UTC (rev 12440) @@ -12,7 +12,7 @@ # Description: Takes obj and mtl files, parses material information # # Author: pyramid -# Version: 2008-09-12 | v0.24 +# Version: 2008-09-15 | v0.26 # Contact: py...@sa... #--------------------------------------------------------------------------------- #inspired by://www.pygame.org/wiki/OBJFileLoader?parent=CookBook @@ -24,6 +24,7 @@ # reads material info from OBJ files # reads material info from MTL files # reads objects from OBJ files +# gets center, forward, up vectors and radius of helper objects #--------------------------------------------------------------------------------- from types import * @@ -285,6 +286,13 @@ up = vnormal(vector(self.getVertexDistance(vertices, center, 2))-center) return up + def getHelperRadius(self, object): + # gets the forward radius of the predefined helper object + vertices = self.getObjectVertices(object) + center = self.getHelperCenter(object) + radius = vlength(vector(self.getVertexLongest(vertices, center))-center) + return radius + def paintObject(): #self.gl_list = glGenLists(1) #glNewList(self.gl_list, GL_COMPILE) Modified: trunk/modtools/UnitConverter/unitconverter.py =================================================================== --- trunk/modtools/UnitConverter/unitconverter.py 2008-09-13 20:13:20 UTC (rev 12439) +++ trunk/modtools/UnitConverter/unitconverter.py 2008-09-15 19:47:41 UTC (rev 12440) @@ -12,7 +12,7 @@ # Description: Takes obj and mtl file inputs, validates mtl files # and creates bfxm output # Author: pyramid -# Version: 2008-09-13 | v0.24 +# Version: 2008-09-15 | v0.26 # Contact: py...@sa... #--------------------------------------------------------------------------------- # Features: @@ -41,21 +41,24 @@ # engine thruster placement from mount helper obj file # turret placement from mount helper obj file and type editor # turret name matching between helper mount naming and registered turret types +# texture file extension check for png #--------------------------------------------------------------------------------- # Known issues: # mesher error: add from Wavefront to BFXM unimplemneted +# converting one obj with submeshes with different textures #--------------------------------------------------------------------------------- # To do: -# check textures for POT dimensions -# check textures for image types accepted by nvcompress -# unit.csv editor - add (more stats, upgrades, ...) -# import and display model using OpenGL +# check textures for POT dimensions (with Python 2.6) +# magic check textures for image types accepted by nvcompress (with Python 2.6) +# unit.csv editor - add (more stats, mounts, docking ports, ...) +# maybe import and display model using OpenGL (just maybe) # integrate LoD and submesh processing (grouped texture assignments) # don't delete obj file path on browse cancel (win) # mesher add operation with several models(subunits) in the same workspace # storing and batch conversion of faction textures # make frames scrollable (for units editor) # improve configuration read/write and screen updates +# converting one obj with submeshes with different textures from appwindow import * from objparse import * @@ -76,10 +79,118 @@ technique = None blendmode = None turret = None +upgradeclass = None class UnitConverter: #-------------------------------------------------------------------------------------------- + # PROCESSING + #-------------------------------------------------------------------------------------------- + def processEvents(self): + # processes various events + # trigger to fill workspace option button + global state + if state!=self.activemodel.get(): + state=self.activemodel.get() + self.getParameters() + self.readObjMaterials() + self.iniWrite() + # trigger for changing faction entry + if self.faction.get()=="(default)": + self.faction.set("") + global faction + if faction!=self.faction.get(): + faction=self.faction.get() + self.refreshTextureInfo() + # trigger for changing technique option + if self.technique.get()=="(none)": + self.technique.set("") + global technique + if technique!=self.technique.get(): + technique=self.technique.get() + self.setParameters() + self.iniWrite() + # trigger for changing blendmode option + global blendmode + if blendmode!=self.blendmode.get(): + blendmode=self.blendmode.get() + self.setParameters() + self.iniWrite() + # trigger for changing turret option + global turret + if turret!=self.subunittype.get(): + turret=self.subunittype.get() + global upgradeclass + if upgradeclass!=self.upgradeclass.get(): + upgradeclass=self.upgradeclass.get() + self.updateUpgradeType() + # call me again + root.after(1000, self.processEvents) + + def uniqify(self, seq): + # Not order preserving removing of key duplicates + return {}.fromkeys(seq).keys() + + def validateInputs(self): + # validates and cross-checks various input parameters + # validates obj and mtl file coherencey + (dirName, fileName) = os.path.split(self.mtlpath.get()) + if len(self.objtext)>0 and not(self.objtext[0][1].get()==fileName): + print "Error (OBJ, MTL) = ", self.objtext[0][1].get(), fileName + tkMessageBox.showwarning("Warning", + "The mtllib entry in the OBJ file ("+self.objtext[0][1].get()+") does not equal the MTL file name ("+fileName+").\n" + + "This may prevent the mesher converter from functioning properly.\n" + + "To remove the problem, you may edit the line in the OBJ file containing the 'mtllib' statement to match the MTL file name.\n" + + "When finished, you may proceed.") + # validates if master textures contain spaces (which nvcompress will not accept) + error = 0 + if not(self.texmaster0.get()=="") and not(self.texmaster4.get().find(" ")==-1): + error = 1 + mastertexture = self.texmaster0.get() + if not(self.texmaster1.get()=="") and not(self.texmaster1.get().find(" ")==-1): + error = 1 + mastertexture = self.texmaster1.get() + if not(self.texmaster2.get()=="") and not(self.texmaster2.get().find(" ")==-1): + error = 1 + mastertexture = self.texmaster2.get() + if not(self.texmaster3.get()=="") and not(self.texmaster3.get().find(" ")==-1): + error = 1 + mastertexture = self.texmaster3.get() + if not(self.texmaster4.get()=="") and not(self.texmaster4.get().find(" ")==-1): + error = 1 + mastertexture = self.texmaster4.get() + if error==1: + print "Error (TEXTURE) = ", self.objpath.get()+"/"+mastertexture + tkMessageBox.showwarning("Warning", + "The master texture ("+self.objpath.get()+"/"+mastertexture+") contains spaces.\n" + + "Nvcompress will not recognize this texture for dds compression.\n" + + "Please substitute the spaces (' ') with underscores ('_') or rename the texture so that it does not contain any spaces.\n" + + "When finished, you may proceed.") + # validates if master textures are of png which nvcompress will not accept other formats) + error = 0 + if self.texmaster0.get()!='' and os.path.splitext(self.texmaster0.get())[1]!='.png': + error = 1 + mastertexture = self.texmaster0.get() + if self.texmaster1.get()!='' and os.path.splitext(self.texmaster1.get())[1]!='.png': + error = 1 + mastertexture = self.texmaster1.get() + if self.texmaster2.get()!='' and os.path.splitext(self.texmaster2.get())[1]!='.png': + error = 1 + mastertexture = self.texmaster2.get() + if self.texmaster3.get()!='' and os.path.splitext(self.texmaster3.get())[1]!='.png': + error = 1 + mastertexture = self.texmaster3.get() + if self.texmaster4.get()!='' and os.path.splitext(self.texmaster4.get())[1]!='.png': + error = 1 + mastertexture = self.texmaster4.get() + if error==1: + print "Error (TEXTURE) = ", self.objpath.get()+"/"+mastertexture + tkMessageBox.showwarning("Warning", + "The master texture ("+mastertexture+") is not of png type\n" + + "Nvcompress will not recognize this texture for dds compression.\n" + + "Please convert your file to png and proceed when finished.") + + #-------------------------------------------------------------------------------------------- # FILE INPUT/OUTPUT #-------------------------------------------------------------------------------------------- def iniRead(self): @@ -236,6 +347,24 @@ self.validateInputs() return fileName + def getFileAndUpdateMaterial(self, command1, var1, nrTexture): + imageFile = command1(var1) + # validate POT size + imageAddress = self.workdir.get()+"/"+imageFile + print "Image = ", imageAddress + #im = Image.open(imageAddress) + #print "Dimensions = ", im.format, im.size, im.mode + # save texture inormation + self.refreshTextureInfo() + self.iniWrite() + + def getFileAndHudImage(self, command1, var1): + imageFile = command1(var1) + self.iniWrite() + # update unit information + (fileBaseName, fileExtension)=os.path.splitext(imageFile) + self.unithud.set(fileBaseName.lower()+'.sprite') + def readObjMaterials(self): # reads material library and material information from obj file and displays materials self.obj = GetObjMaterial(self.objpath.get()) @@ -307,8 +436,14 @@ self.unitscale.set(self.unit[8]) self.unitcockpit.set(self.unit[9]) self.unitshield.set(self.unit[14]) - self.unitturrets.set(self.unit[99]) + self.unitupgrades.set(self.unit[97]) + self.unitsubunits.set(self.unit[99]) self.unitthruster.set(self.unit[101]) + self.unitmounts.set(self.unit[102]) + self.unitdocks.set(self.unit[104]) + thrusters = self.parseMounts(self.unitthruster.get()) + if len(thrusters)>0: + self.thrustertype.set(thrusters[0][0]) if not(self.hudimage.get()==''): self.unithud.set(self.getUnitName().lower()+'-hud.sprite') # update shield information @@ -324,8 +459,8 @@ #update mounts self.displayThrusterDiameter() self.currentturret.set('') - self.turrettype.set('') - self.updateTurrets() + self.subunittype.set('') + self.updateSubunits() def writeUnitCsv(self): # writes unit.csv from curretn display @@ -344,8 +479,11 @@ self.unit[9] = self.unitcockpit.get() self.unit[13] = '{'+self.unitname.get().lower()+'.bfxm;;}' self.unit[14] = self.unitshield.get() - self.unit[99] = self.unitturrets.get() + self.unit[97] = self.unitupgrades.get() + self.unit[99] = self.unitsubunits.get() self.unit[101] = self.unitthruster.get() + self.unit[102] = self.unitmounts.get() + self.unit[104] = self.unitdocks.get() # write units.csv if not(self.unitcsv.updateUnit(self.unit)): # if update fails self.unitcsv.insertUnit(self.unit) # insert new record @@ -363,47 +501,42 @@ vsmission.updateNodeAttribute('flightgroup', 'type', self.unitname.get()) vsmission.saveMissionFile() + def readUnitUpgrades(self): + # reads upgrades from unit.csv and updates option dropdown + # read upgrades + if self.vegastrike.get()=='': + return + self.unitcsv = VsUnitCsv(self.vegastrike.get()) + self.upgrades = self.unitcsv.getObjectType("Upgrade_Additive") + self.upgrades += self.unitcsv.getObjectType("Upgrade_Replacement") + # get classes + upgrades = [] + for u in range(len(self.upgrades)): + upgrades += [self.upgrades[u].strip('_0123456789')] + classes = self.uniqify(upgrades) + # set class option dropdown + self.refreshOptionMenu(self.optupclasses, classes, self.upgradeclass) + + def updateUpgradeType(self): + # updates upgrate type option dropdown based on selected class + upgrades = [] + for u in range(len(self.upgrades)): + if self.upgrades[u].find(self.upgradeclass.get())!=-1: + upgrades += [self.upgrades[u]] + self.refreshOptionMenu(self.optupgrades, upgrades, self.upgradetype) + + def readUnitWeapons(self): + # reads weapons from units.csv + # read upgrades + if self.vegastrike.get()=='': + return + self.unitcsv = VsUnitCsv(self.vegastrike.get()) + self.weapons = self.unitcsv.getObjectType("Weapon") + #print "Weapons = ", self.weapons + #-------------------------------------------------------------------------------------------- - # PROCESSING + # TEXTURES #-------------------------------------------------------------------------------------------- - def processEvents(self): - # processes various events - # trigger to fill workspace option button - global state - if state!=self.activemodel.get(): - state=self.activemodel.get() - self.getParameters() - self.readObjMaterials() - self.iniWrite() - # trigger for changing faction entry - if self.faction.get()=="(default)": - self.faction.set("") - global faction - if faction!=self.faction.get(): - faction=self.faction.get() - self.refreshTextureInfo() - # trigger for changing technique option - if self.technique.get()=="(none)": - self.technique.set("") - global technique - if technique!=self.technique.get(): - technique=self.technique.get() - self.setParameters() - self.iniWrite() - # trigger for changing blendmode option - global blendmode - if blendmode!=self.blendmode.get(): - blendmode=self.blendmode.get() - self.setParameters() - self.iniWrite() - # trigger for changing turret option - global turret - if turret!=self.turrettype.get(): - turret=self.turrettype.get() - #self.updateTurrets() - # call me again - root.after(1000, self.processEvents) - def getTextureForMaster(self,iMaterial,iTexture): # creates a texture name by convention "text_m_s_t" where # m - mesh @@ -469,46 +602,9 @@ self.setParameters() self.iniWrite() - def validateInputs(self): - # validates and cross-checks various input parameters - # validates obj and mtl file coherencey - (dirName, fileName) = os.path.split(self.mtlpath.get()) - if len(self.objtext)>0 and not(self.objtext[0][1].get()==fileName): - print "Error (OBJ, MTL) = ", self.objtext[0][1].get(), fileName - tkMessageBox.showwarning("Warning", - "The mtllib entry in the OBJ file ("+self.objtext[0][1].get()+") does not equal the MTL file name ("+fileName+").\n" + - "This may prevent the mesher converter from functioning properly.\n" + - "To remove the problem, you may edit the line in the OBJ file containing the 'mtllib' statement to match the MTL file name.\n" + - "When finished, you may proceed.") - # validates if master textures contain spaces (which nvcompress will not accept) - error = 0 - if not(self.texmaster0.get()=="") and not(self.texmaster4.get().find(" ")==-1): - error = 1 - mastertexture = self.texmaster0.get() - if not(self.texmaster1.get()=="") and not(self.texmaster1.get().find(" ")==-1): - error = 1 - mastertexture = self.texmaster1.get() - if not(self.texmaster2.get()=="") and not(self.texmaster2.get().find(" ")==-1): - error = 1 - mastertexture = self.texmaster2.get() - if not(self.texmaster3.get()=="") and not(self.texmaster3.get().find(" ")==-1): - error = 1 - mastertexture = self.texmaster3.get() - if not(self.texmaster4.get()=="") and not(self.texmaster4.get().find(" ")==-1): - error = 1 - mastertexture = self.texmaster4.get() - if error==1: - print "Error (TEXTURE) = ", self.objpath.get()+"/"+mastertexture - tkMessageBox.showwarning("Warning", - "The master texture ("+self.objpath.get()+"/"+mastertexture+") contains spaces.\n" + - "Nvcompress will not recognize this texture for dds compression.\n" + - "Please substitute the spaces (' ') with underscores ('_') or rename the texture so that it does not contain any spaces.\n" + - "When finished, you may proceed.") - #-------------------------------------------------------------------------------------------- # WORKSPACE #-------------------------------------------------------------------------------------------- - def updateWorkspace(self): # updates workspace parameters exists = 0 @@ -583,8 +679,6 @@ self.iniWrite() except: self.newWorkspace() - #print "Activemodel = ", self.activemodel.get() - #print "Models = ", self.models self.refreshOptionMenu(self.optws, self.models, self.activemodel) def newWorkspace(self): @@ -690,11 +784,13 @@ self.centers = [] self.forward = [] self.up = [] + self.radius = [] for i in range(len(self.mounts)): self.centers += [self.obj.getHelperCenter(i)] self.forward += [self.obj.getHelperForward(i)] self.up += [self.obj.getHelperUp(i)] - self.turrets = self.parseMounts(self.unitturrets.get()) + self.radius += [self.obj.getHelperRadius(i)] + self.subunits = self.parseMounts(self.unitsubunits.get()) return self.mounts def resetUnit(self): @@ -713,7 +809,12 @@ for i in range(len(self.mounts)): if not(self.mounts[i].lower().find('engine')): # {supernova.bmp.bfxm;0;0;-1260;100;;;;;} - thruster += '{supernova.bmp.bfxm;'+str(round(self.centers[i][0],2))+';'+str(round(self.centers[i][1],2))+';'+str(round(self.centers[i][2],2))+';' + thruster += '{' + if self.thrustertype.get()!='': + thruster += self.thrustertype.get() + else: + thruster += 'supernova.bmp.bfxm' + thruster += ';'+str(round(self.centers[i][0],2))+';'+str(round(self.centers[i][1],2))+';'+str(round(self.centers[i][2],2))+';' if (float(self.unitthrdia.get())>0): thruster += self.unitthrdia.get()+';;;;;}' else: @@ -745,124 +846,141 @@ #print "Mounts = ", len(mounts), mounts return items - def updateTurrets(self): + def updateSubunits(self): # update turret screen parameters # self.currentturret = screen counter - # self.unitturrets = complete units column - # self.turrettype = option dropdown - # self.turrets = units turrets list + # self.unitsubunits = complete subunits column + # self.subunittype = option dropdown + # self.subunits = units subunits list # self.mounts = obj mount helper list - # self.tmounts = turret mount helper list - self.turrets = self.parseMounts(self.unitturrets.get()) - self.tmounts = [] - turrets = '' + # self.smounts = turret mount helper list + self.subunits = self.parseMounts(self.unitsubunits.get()) + self.smounts = [] + subunits = '' # create turret mounts from helper object if (self.getWorkspaceMount()>=0) and (self.unitname.get().lower()==self.getUnitName().lower()): for i in range(len(self.mounts)): - if not(self.mounts[i].lower().find('turret')==-1): - self.tmounts += [self.mounts[i]] + if (self.mounts[i].lower().find('turret')!=-1) or (self.mounts[i].lower().find('subunit')!=-1): + self.smounts += [self.mounts[i]] # update screen - if not(self.unitname.get()==''): # and (self.unitname.get().lower()==self.getUnitName().lower()): + if not(self.unitname.get()==''): # update type option - if not(self.unitturrets.get()=='') and (self.turrettype.get()==''): + if not(self.unitsubunits.get()=='') and (self.subunittype.get()==''): self.currentturret.set(1) - if (len(self.tmounts)>0): - mountname = self.tmounts[0].split('_')[1] - if self.findTurretName(mountname)!='': - self.turrettype.set(self.findTurretName(mountname)) + if (len(self.smounts)>0): + mountname = self.smounts[0].split('_')[1] + if self.findSubunitName(mountname)!='': + self.subunittype.set(self.findSubunitName(mountname)) else: - self.turrettype.set(mountname) + self.subunittype.set(mountname) else: - self.turrettype.set(self.turrets[0][0]) - # create turrets entry - for i in range(len(self.turrets)): - turrets += '{' - # get turrets from onj mounts - if not(self.currentturret.get()=='') and not(self.turrettype.get()=='') and (i<=len(self.tmounts)-1): - # and (i==int(self.currentturret.get())-1) and (len(self.tmounts)>0) - index = self.mounts.index(self.tmounts[i]) + self.subunittype.set(self.subunits[0][0]) + # create subunits entry + for i in range(len(self.subunits)): + subunits += '{' + # get subunits from obj mounts + if not(self.currentturret.get()=='') and not(self.subunittype.get()=='') and (i<=len(self.smounts)-1): + # and (i==int(self.currentturret.get())-1) and (len(self.smounts)>0) + index = self.mounts.index(self.smounts[i]) if (i==int(self.currentturret.get())-1): - turrets += self.turrettype.get() + subunits += self.subunittype.get() # get turret name from units - elif (len(self.turrets)>len(self.tmounts)): - turrets += self.turrets[i][0] + elif (len(self.subunits)>len(self.smounts)): + subunits += self.subunits[i][0] else: - turrets += self.turrettype.get() - turrets += ';'+str(round(self.centers[index][0],2))+';'+str(round(self.centers[index][1],2))+';'+str(round(self.centers[index][2],2))+';' - turrets += str(round(self.forward[index][0],2))+';'+str(round(self.forward[index][1],2))+';'+str(round(self.forward[index][2],2))+';' - turrets += str(round(self.up[index][0],2))+';'+str(round(self.up[index][1],2))+';'+str(round(self.up[index][2],2))+';' - turrets += '180.0}' + subunits += self.subunittype.get() + subunits += ';'+str(round(self.centers[index][0],2))+';'+str(round(self.centers[index][1],2))+';'+str(round(self.centers[index][2],2))+';' + subunits += str(round(self.forward[index][0],2))+';'+str(round(self.forward[index][1],2))+';'+str(round(self.forward[index][2],2))+';' + subunits += str(round(self.up[index][0],2))+';'+str(round(self.up[index][1],2))+';'+str(round(self.up[index][2],2))+';' + subunits += '180.0}' # get turret from units.csv else: - for t in range(len(self.turrets[i])): - if t>0: turrets += ';' - turrets += self.turrets[i][t] - turrets += '}' - self.unitturrets.set(turrets) - #self.turrets = self.parseMounts(self.unitturrets.get()) + for t in range(len(self.subunits[i])): + if t>0: subunits += ';' + subunits += self.subunits[i][t] + subunits += '}' + self.unitsubunits.set(subunits) - def findTurretName(self,mountname): + def findSubunitName(self,mountname): # matches substring from helper object with preset turret type found = '' - for i in range(len(self.TURRETTYPES)): - if self.TURRETTYPES[i].find(mountname)>=0: - found = self.TURRETTYPES[i] + for i in range(len(self.SUBUNITTYPES)): + if self.SUBUNITTYPES[i].find(mountname)>=0: + found = self.SUBUNITTYPES[i] return found - def prevTurret(self): - if (len(self.turrets)>0): + def prevSubunit(self): + if (len(self.subunits)>0): if (self.currentturret.get()=='') or (int(self.currentturret.get())==1): - self.currentturret.set(len(self.turrets)) + self.currentturret.set(len(self.subunits)) elif int(self.currentturret.get())>1: self.currentturret.set(int(self.currentturret.get())-1) - #self.turrettype.set(self.turrets[int(self.currentturret.get())-1][0]) - if (len(self.tmounts)>=int(self.currentturret.get())) and (self.unitname.get().lower()==self.getUnitName().lower()): - mountname = self.tmounts[int(self.currentturret.get())-1].split('_')[1] - if self.findTurretName(mountname)!='': - self.turrettype.set(self.findTurretName(mountname)) + #self.subunittype.set(self.subunits[int(self.currentturret.get())-1][0]) + if (len(self.smounts)>=int(self.currentturret.get())) and (self.unitname.get().lower()==self.getUnitName().lower()): + mountname = self.smounts[int(self.currentturret.get())-1].split('_')[1] + if self.findSubunitName(mountname)!='': + self.subunittype.set(self.findSubunitName(mountname)) else: - self.turrettype.set(mountname) + self.subunittype.set(mountname) else: - self.turrettype.set(self.turrets[int(self.currentturret.get())-1][0]) + self.subunittype.set(self.subunits[int(self.currentturret.get())-1][0]) - def nextTurret(self): - if (len(self.turrets)>0): - if self.currentturret.get()=='' or int(self.currentturret.get())==len(self.turrets): + def nextSubunit(self): + if (len(self.subunits)>0): + if self.currentturret.get()=='' or int(self.currentturret.get())==len(self.subunits): self.currentturret.set(1) - elif int(self.currentturret.get())<len(self.turrets): + elif int(self.currentturret.get())<len(self.subunits): self.currentturret.set(int(self.currentturret.get())+1) - #self.updateTurrets() ... [truncated message content] |