1# ##### BEGIN GPL LICENSE BLOCK #####
2#
3#  This program is free software; you can redistribute it and/or
4#  modify it under the terms of the GNU General Public License
5#  as published by the Free Software Foundation; either version 2
6#  of the License, or (at your option) any later version.
7#
8#  This program is distributed in the hope that it will be useful,
9#  but WITHOUT ANY WARRANTY; without even the implied warranty of
10#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11#  GNU General Public License for more details.
12#
13#  You should have received a copy of the GNU General Public License
14#  along with this program; if not, write to the Free Software Foundation,
15#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16#
17# ##### END GPL LICENSE BLOCK #####
18# This is an addon for Blender, that provides some tools to calculate
19# ship stats, and exports it next to the blend file with the same name.
20
21import bpy
22import math
23import bpy_extras.io_utils
24import os
25
26bl_info = {
27	"name": "Pioneer Ship Planner",
28	"author": "Szilard Balint (nozmajner)",
29	"version": (0,1,5),
30	"blender": (2, 76, 0),
31	"location": "Properties -> Scene -> Ship Planner",
32	"description": "Calculates ship stats for Pioneer Space Simulator",
33	"warning": "",
34	"wiki_url": "N/A",
35	"tracker_url": "N/A",
36	"category": "Scene"}
37
38gee = 9.81
39def sum_mass(hull, fuel, cap, cargo_cap):
40	result = [hull+fuel+cap, hull+fuel, hull+fuel+cargo_cap]
41	return result
42
43def acc(mass, thrust):
44	acc_full = (thrust/mass[0]/gee) #mass*1000 volt
45	acc_empty = (thrust/mass[1]/gee)
46
47	if acc_full <= 0.0001:
48		result_full = "<0.0001"
49	else:
50		result_full = acc_full
51
52	if acc_empty <= 0.0001:
53		result_empty = "<0.0001"
54	else:
55		result_empty = acc_empty
56
57	result = [result_full, result_empty]
58
59	return result
60
61def deltav(ev, mass, fuel_cap):
62	dv = (float(ev))*(math.log(float(mass+fuel_cap)/mass))
63	if dv <=0.0001:
64		result = "<0.0001"
65	else:
66		result = dv
67	return result
68
69
70 #Operator example
71class VesselExport(bpy.types.Operator): # , bpy_extras.io_utils.ExportHelper .ExportHelper feldobja az export ablakot, ha megnyomom a gombot
72	"""Export shipdef.lua"""
73	bl_idname = "object.simple_operator"
74	bl_label = "Export shipdef"
75	filename_ext = ".lua"
76
77	@classmethod
78	def poll(cls, context):
79		return context.active_object is not None
80
81	def execute(self, context):
82		print("Krumpli")
83		scene = bpy.data.scenes["Scene"]
84#		file = open(filepath, 'w', encoding="ansi", newline = "\n")
85		file = open(os.path.splitext(bpy.data.filepath)[0] + ".json", 'w', newline = "\n")
86		fw = file.write
87		#writing starting bracket
88		fw("{"+"\n")
89		#writing ship data
90		fw('\t"model" : "' + scene.ModelName + '",\n')
91		fw('\t"name" : "' + scene.ShipName + '",\n')
92		fw('\t"cockpit" : "' + scene.Cockpit + '",\n')
93		fw('\t"manufacturer" : "' + scene.ManufacturerName + '",\n')
94		fw('\t"ship_class" : "' + scene.ShipClass + '",\n')
95		fw('\t"min_crew" : ' + str(scene.Min_crew) + ',\n')
96		if scene.Max_crew < scene.Min_crew: #checks if max crew is lower than minimum to ensure it's sanity
97			fw('\t"max_crew" : ' + str(scene.Min_crew) + ',\n')
98		else:
99			fw('\t"max_crew" : ' + str(scene.Max_crew) + ',\n')
100		fw('\t"price" : ' + str(scene.Price) + ',\n')
101		fw('\t"hull_mass" : ' + str(scene.HullMass) + ',\n')
102		fw('\t"capacity" : ' + str(scene.Capacity) + ',\n')
103		#slots part
104		fw('\t"slots" : {\n')
105		if scene.Capacity > scene.CargoCap:	#checks if cargo capacity fits in overall capacity, if not, then uses overall capacity.
106			fw('\t\t"cargo" : ' + str(scene.CargoCap) + ',\n')
107		else:
108			fw('\t\t"cargo" : ' + str(scene.Capacity) + ',\n')
109		fw('\t\t"engine" : ' + str(scene.Max_Engine) + ',\n')
110		#no default checking for these, sisnce I like them being around in each ship file
111		fw('\t\t"scoop" : ' + str(scene.Scoop) + ',\n')
112		fw('\t\t"laser_front" : ' + str(scene.laser_front) + ',\n')
113		fw('\t\t"laser_rear" : ' + str(scene.laser_rear) + ',\n')
114		fw('\t\t"missile" : ' + str(scene.Max_missile) + ',\n')
115		# these are only writen, if they aren't on their default value
116		if scene.Sensor != 8:
117			fw('\t\t"sensor" : ' + str(scene.Sensor) + ',\n')
118		if scene.Max_ecm != 1:
119			fw('\t\t"ecm" : ' + str(scene.Max_ecm) + ',\n')
120		if scene.Autopilot != 1:
121			fw('\t\t"autopilot" : ' + str(scene.Autopilot) + ',\n')
122		if scene.Scanner != 1:
123			fw('\t\t"scanner" : ' + str(scene.Scanner) + ',\n')
124		if scene.Radarmapper != 1:
125			fw('\t\t"radar" : ' + str(scene.Radarmapper) + ',\n')
126		if scene.Hypercloud != 1:
127			fw('\t\t"hypercloud" : ' + str(scene.Hypercloud) + ',\n')
128		if scene.Shield != 9999:
129			fw('\t\t"shield" : ' + str(scene.Shield) + ',\n')
130		if scene.Energybooster != 1:
131			fw('\t\t"energy_booster" : ' + str(scene.Energybooster) + ',\n')
132		if scene.Cabin != 1:
133			fw('\t\t"cabin" : ' + str(scene.Cabin) + ',\n')
134		if scene.Lasercooler != 1:
135			fw('\t\t"laser_cooler" : ' + str(scene.Lasercooler) + ',\n')
136		if scene.Cargolifesupport != 1:
137			fw('\t\t"cargo_life_support" : ' + str(scene.Cargolifesupport) + ',\n')
138		if scene.Tradecomp != 1:
139			fw('\t\t"trade_analyzer" : ' + str(scene.Tradecomp) + ',\n')
140		if scene.Autorepair != 1:
141			fw('\t\t"hull_autorepair" : ' + str(scene.Autorepair) + ',\n')
142		fw('\t\t"atmo_shield" : ' + str(scene.Atmoshield) + '\n') #last entry doesn't have a comma,!
143		fw('\t},\n')
144		#performance stuff
145		fw('\t"effective_exhaust_velocity" : ' + str(int(scene.EV*1000)) + ',\n')
146		fw('\t"thruster_fuel_use" : -1.0,\n') # to avoid problems if line missing
147		fw('\t"fuel_tank_mass" : ' + str(scene.FuelMass) + ',\n')
148		if scene.Max_Engine < scene.Hyperdrive: #checking if default drive class is larger than max, if so using the max class instead
149			fw('\t"hyperdrive_class" : ' + str(scene.Max_Engine) + ',\n')
150		else:
151			fw('\t"hyperdrive_class" : ' + str(scene.Hyperdrive) + ',\n')
152		#thrust values
153		fw('\t"forward_thrust" : ' + str(int(scene.FWD*1000)) + ',\n')
154		fw('\t"reverse_thrust" : ' + str(int(scene.BWD*1000)) + ',\n')
155		fw('\t"up_thrust" : ' + str(int(scene.UP*1000)) + ',\n')
156		fw('\t"down_thrust" : ' + str(int(scene.DWN*1000)) + ',\n')
157		fw('\t"left_thrust" : ' + str(int(scene.LEFT*1000)) + ',\n')
158		fw('\t"right_thrust" : ' + str(int(scene.RIGHT*1000)) + ',\n')
159		fw('\t"angular_thrust" : ' + str(int(scene.ANG*1000)) + '\n')
160		fw('}')
161
162
163
164		file.close()
165
166		return {'FINISHED'}
167
168
169class ShipPlanner(bpy.types.Panel):
170		"""Ship stats planner utility for Pioneer"""
171		bl_idname = "ShipPlanner"
172		bl_label = "Ship Planner"
173		bl_space_type = 'PROPERTIES'
174		bl_region_type = 'WINDOW'
175		bl_context = 'scene'
176		#bl_options = { 'UNDO'}
177
178		def draw(self, context):
179			layout = self.layout
180			scn = bpy.context.scene
181			scene = bpy.data.scenes["Scene"]
182
183			#row_init = layout.row()
184			#row_init.operator("InitProps.bl_idname", text = "InitProps.bl_label")
185
186			ship_box = layout.box()
187			ship_box.label("Ship", icon = "AUTO")
188			row_name = ship_box.row()
189			row_name.prop(scn, 'ShipName', text = "Name")	#, '["Name"]')
190			row_model = ship_box.row()
191			row_model.prop(scn, 'ModelName')
192			row_cockpit = ship_box.row()
193			row_cockpit.prop(scn, 'Cockpit')
194			row_manufacturer = ship_box.row()
195			row_manufacturer.prop( scn, 'ManufacturerName')
196			row_class = ship_box.row()
197			row_class.prop( scn, 'ShipClass')
198			row_price = ship_box.row()
199			row_price.prop(scn, 'Price')
200
201			row_crew = ship_box.row()
202			row_crew.prop(scn, 'Min_crew')
203			row_crew.prop(scn, 'Max_crew')
204
205			mass_box = layout.box()
206			mass_box.label("Masses (t)", icon = "OBJECT_DATA")
207			row_hull = mass_box.row()
208			#row_hull.label("Hull mass")
209			row_hull.prop(scn, 'HullMass')
210			row_hull.prop(scn, 'FuelMass', text = "Fuel mass")
211
212			row_cap = mass_box.row()
213			#row_cap.label("Capacity")
214			row_cap.prop(scn, 'Capacity')
215			row_cap.prop(scn, 'CargoCap', text = "Cargo cap")
216
217			mass = sum_mass(scene.HullMass, scene.FuelMass, scene.Capacity, scn.CargoCap) # calculate ship mass
218			row_masses = mass_box.row()
219			row_masses.label(str("Full mass: " + str(mass[0]) + "t"))
220			row_masses.label(str("Empty mass: " + str(mass[1]) + "t"))
221			row_masses.label(str("Cargo mass: " + str(mass[2]) + "t"))
222
223			########
224			thr_box = layout.box()
225			thr_box.label("Thrust (kN)", icon = "LAMP_SPOT")
226
227			row1 = thr_box.row(align = True)
228			#row1.label("Longitudal")
229			row1.prop(scn, 'FWD', text = "fwd")
230			row1.prop(scn, 'BWD', text = "bwd")
231
232			row2 = thr_box.row(align = True)
233			#row2.label("Acceleration:")
234			acc_fwd = acc(mass, scene.FWD)
235			acc_bwd = acc(mass, scene.BWD)
236			row2.label("F: " + str(acc_fwd[0])[0:6] + " G / E: " + str(acc_fwd[1])[0:6] +" G")
237			row2.label("F: " + str(acc_bwd[0])[0:6] + " G / E: " + str(acc_bwd[1])[0:6] +" G")
238
239			row3 = thr_box.row(align = True)
240			#row3.label("Vertical")
241			row3.prop(scn, 'UP', text = "up")
242			row3.prop(scn, 'DWN',text = "down")
243
244			row4 = thr_box.row(align = True)
245			#row4.label("Acceleration:")
246			acc_up = acc(mass, scene.UP)
247			acc_down = acc(mass, scene.DWN)
248			row4.label("F: " + str(acc_up[0])[0:6] + " G / E: " + str(acc_up[1])[0:6] +" G")
249			row4.label("F: " + str(acc_down[0])[0:6] + " G / E: " + str(acc_down[1])[0:6] +" G")
250
251			row5 = thr_box.row(align = True)
252			#row5.label("Horizontal")
253			row5.prop(scn, 'LEFT', text = "left")
254			row5.prop(scn, 'RIGHT', text = "right")
255
256			row6 = thr_box.row(align = True)
257			#row6.label("Acceleration:")
258			acc_left = acc(mass, scene.LEFT)
259			acc_right = acc(mass, scene.RIGHT)
260			row6.label("F: " + str(acc_left[0])[0:6] + " G / E: " + str(acc_left[1])[0:6] +" G")
261			row6.label("F: " + str(acc_right[0])[0:6] + " G / E: " + str(acc_right[1])[0:6] +" G")
262
263			row7 = thr_box.row(align = True)
264			#row5.label("Angular")
265			row7.prop(scn, 'ANG', text = "angular")
266			########
267			thr_box = layout.box()
268			thr_box.label("Efficiency", icon = "IPO")
269
270			row_EV = thr_box.row(align = True)
271			row_EV.label("Exhaust velocity (km/s):")
272			row_EV.prop(scn, 'EV', text = "ev")
273			row_deltaV = thr_box.row(align = True)
274			row_deltaV.label("DeltaV:")
275
276			row_empty = thr_box.row(align = True)
277			deltav_empty = deltav(scene.EV, scene.HullMass, scene.FuelMass)
278			row_empty.label("Empty: " + str(deltav_empty)[0:10] + " km/s")
279
280			row_full = thr_box.row(align = True)
281			deltav_full = deltav(scene.EV, (scene.HullMass+scene.Capacity), scene.FuelMass)
282			row_full.label("Full: " + str(deltav_full)[0:10] + " km/s")
283
284			row_maximum = thr_box.row(align = True)
285			deltav_max = deltav(scene.EV, scene.HullMass, (scene.FuelMass+scene.CargoCap))
286			row_maximum.label("Max: " + str(deltav_max)[0:10] + " km/s")
287
288			 ###########
289
290			equip_box = layout.box()
291			equip_box.label("Equipment mounts", icon = "PLUGIN")
292
293			row_hyperdrive = equip_box.row(align = True)
294			row_hyperdrive.prop(scn, 'Hyperdrive', text = "Hyperdrive")
295			row_hyperdrive.prop(scn, 'Max_Engine', text = "Max")
296
297			row_wep = equip_box.row(align = True)
298			row_wep.prop(scn, 'laser_front', text = "Front laser")
299			row_wep.prop(scn, 'laser_rear', text = "Rear laser")
300
301			row_cooling = equip_box.row(align = True)
302			row_cooling.prop(scn, 'Missiles', text = "Missiles")
303
304			row_cooling = equip_box.row(align = True)
305			row_cooling.prop(scn, 'Lasercooler', text = "Laser cooling Booster")
306
307			row_scoop = equip_box.row(align = True)
308			row_scoop.prop(scn, 'Scoop', text = "Scoop")
309
310			row_scanner = equip_box.row(align = True)
311			row_scanner.prop(scn, 'Scanner', text = "Scanner")
312			row_scanner.prop(scn, 'Radarmapper', text = "Radar Mapper")
313
314			row_hypercloud = equip_box.row(align = True)
315			row_hypercloud.prop(scn, 'Hypercloud', text = "Hypercloud analyzer")
316			row_hypercloud.prop(scn, 'Sensor', text = "(Sensor)")
317
318			row_ecm = equip_box.row(align = True)
319			row_ecm.prop(scn, 'Max_ecm', text = "ECM")
320
321			row_atmoshield = equip_box.row(align = True)
322			row_atmoshield.prop(scn, 'Atmoshield', text = 'Atmo shielding')
323
324			row_shield = equip_box.row(align = True)
325			row_shield.prop(scn, 'Shield', text = 'Max Shield')
326			row_shield.prop(scn, 'Energybooster', text = 'Energy Booster')
327
328			row_cabin = equip_box.row(align = True)
329			row_cabin.prop(scn, 'Cabin', text = 'Max Passenger Cabin')
330
331			row_cargolife = equip_box.row(align = True)
332			row_cargolife.prop(scn, 'Cargolifesupport', text = 'Cargo bay Life support')
333
334			row_autopilot = equip_box.row(align = True)
335			row_autopilot.prop(scn, 'Autopilot', text = 'Autopilot')
336
337			row_autorepair = equip_box.row(align = True)
338			row_autorepair.prop(scn, 'Autorepair', text = 'Hull Autorepair system')
339
340			row_tradecomp = equip_box.row(align = True)
341			row_tradecomp.prop(scn, 'Tradecomp', text = 'Trade analyzer')
342
343			############################
344
345			vessel_export = layout.box()
346			vessel_export.label("Export", icon = "EXPORT")
347
348			exportrow = vessel_export.row(align = True)
349			exportrow.operator("object.simple_operator", text = "Export")
350
351
352
353
354
355#class InitProps(bpy.types.Operator):
356#   """Tooltip"""
357#   bl_idname = "scene.init_my_prop"
358#   bl_label = "Init properties"
359#
360#   @classmethod
361#	def poll(cls, context):
362#		return context.scene
363#   def execute(self, context):
364#	   if context.scene.Capacity != 1:
365#		   context.scene.Capacity = 1
366#	   return {'FINISHED'}
367
368
369#Registering the operator
370
371def register():
372	bpy.utils.register_class(ShipPlanner)
373	bpy.utils.register_class(VesselExport)
374
375	bpy.types.Scene.Valami = bpy.props.FloatProperty(   #ezzel hozom letre, tobbi feljebb
376		name = "Valami",
377		default = 0.0,
378		description = "Ez bizony mar valami")
379
380	#######Ship box######
381	bpy.types.Scene.ShipName = bpy.props.StringProperty(
382		name = "Ship Name",
383		default = "name",
384		description = "Name of the ship, displayed in the game.")
385
386	bpy.types.Scene.Cockpit = bpy.props.StringProperty(
387		name = "Cockpit",
388		default = '',
389		description = "Custom cockpit .model Leave blank for default cockpit.")
390
391	bpy.types.Scene.ManufacturerName = bpy.props.StringProperty(
392		name = "Manufacturer",
393		default = "opli",
394		description = "Manufacturer, for logo selection. Valid values are the file names in the icons/manufacturers folder - without extension")
395
396
397	bpy.types.Scene.ShipClass = bpy.props.StringProperty(
398		name = "Ship class",
399		default = "light_courier",
400		description = "Ship class, for class icon display in the ship marker. Valid values are in the icons/shipclass folder")
401
402	bpy.types.Scene.ModelName = bpy.props.StringProperty(
403		name = "Model file",
404		default = "model",
405		description = "Name of the model file to be used. They are in the data/models/ folder")
406
407	bpy.types.Scene.Price = bpy.props.IntProperty(
408		name = "Price",
409		default = 1,
410		min = 1,
411		description = "Base price of the ship.")
412
413	bpy.types.Scene.Min_crew = bpy.props.IntProperty(
414		name = "Min crew",
415		default = 1,
416		min = 1,
417		description = "Minimum crew capacity of the ship.")
418
419	bpy.types.Scene.Max_crew = bpy.props.IntProperty(
420		name = "Max crew",
421		default = 1,
422		min = 1,
423		description = "Maximum crew capacity of the ship.")
424
425
426	#######Masses box######
427	bpy.types.Scene.HullMass = bpy.props.IntProperty(
428		name = "Hull mass",
429		default = 1,
430		min = 1,
431		max = 1000000000,
432		description = "Mass of the hull in tonnes.")
433
434	bpy.types.Scene.FuelMass = bpy.props.IntProperty(
435		name = "Fuel tank mass",
436		default = 1,
437		min = 1,
438		max = 1000000000,
439		description = "Capacity of the fuel tank in tonnes.")
440
441	bpy.types.Scene.Capacity = bpy.props.IntProperty(
442		name = "Capacity",
443		default = 1,
444		min = 1,
445		max = 1000000000,
446		description = "Equipment and cargo capacity of the ship in tonnes.")
447
448	bpy.types.Scene.CargoCap = bpy.props.IntProperty(
449		name = "Cargo capacity",
450		default = 1,
451		min = 1,
452		max = 1000000000,
453		description = "Cargo capacity in tonnes.")
454
455	#######Thrust box#######
456	bpy.types.Scene.FWD = bpy.props.FloatProperty(
457		name = "FWD thrust",
458		default = 1.0,
459		min = 1.0,
460		max = 1000000000.0,
461		description = "Forward thrust in kN's")
462
463	bpy.types.Scene.BWD = bpy.props.FloatProperty(
464		name = "BWD thrust",
465		default = 1.0,
466		min = 1.0,
467		max = 1000000000.0,
468		description = "Backward thrust in kN's")
469
470	bpy.types.Scene.UP = bpy.props.FloatProperty(
471		name = "UP thrust",
472		default = 1.0,
473		min = 1.0,
474		max = 1000000000.0,
475		description = "Upward thrust in kN's")
476
477	bpy.types.Scene.DWN = bpy.props.FloatProperty(
478		name = "DOWD thrust",
479		default = 1.0,
480		min = 1.0,
481		max = 1000000000.0,
482		description = "Downward thrust in kN's")
483
484	bpy.types.Scene.LEFT = bpy.props.FloatProperty(
485		name = "LEFT thrust",
486		default = 1.0,
487		min = 1.0,
488		max = 1000000000.0,
489		description = "Leftward thrust in kN's")
490
491	bpy.types.Scene.RIGHT = bpy.props.FloatProperty(
492		name = "RIGHT thrust",
493		default = 1.0,
494		min = 1.0,
495		max = 1000000000.0,
496		description = "Rightward thrust in kN's")
497
498	bpy.types.Scene.ANG = bpy.props.FloatProperty(
499		name = "ANG thrust",
500		default = 1.0,
501		min = 1.0,
502		max = 1000000000.0,
503		description = "Angular thrust in kN's")
504
505	##########Efficiency box#########
506	bpy.types.Scene.EV = bpy.props.FloatProperty(
507		name = "ev",
508		default = 1.0,
509		min = 1.0,
510		max = 1000000000.0,
511		description = "Exhaust velocity in km/s")
512
513	##########Equipments#############
514	bpy.types.Scene.Hyperdrive = bpy.props.IntProperty(
515		default = 1,
516		min = 0,
517		max = 13,
518		description = "Default hyperdrive class.")
519
520	bpy.types.Scene.Max_Engine = bpy.props.IntProperty(
521		default = 1,
522		min = 0,
523		max = 13,
524		description = "Maximum hyperdrive class. 0 for no hyperspace capability")
525
526	bpy.types.Scene.laser_front = bpy.props.IntProperty(
527		default = 1,
528		min = 0,
529		max = 1,
530		description = "Front cannon mount")
531
532	bpy.types.Scene.laser_rear = bpy.props.IntProperty(
533		default = 0,
534		min = 0,
535		max = 1,
536		description = "Rear cannon mount")
537
538	bpy.types.Scene.Missiles = bpy.props.IntProperty(
539		default = 0,
540		min = 0,
541		max = 50,
542		description = "Number of missiles the ship can carry")
543
544	bpy.types.Scene.Max_missile = bpy.props.IntProperty(
545		default = 0,
546		min = 0,
547		max = 1000,
548		description = "Maximum number of missiles")
549
550	bpy.types.Scene.Scoop = bpy.props.IntProperty(
551		default = 2,
552		min = 0,
553		max = 3,
554		description = "Scoop compatibility 0: no scoop, 1: fuel scoop, 2: cargo scoop, 3: combo scoop")
555
556
557	bpy.types.Scene.Max_ecm = bpy.props.IntProperty(
558		default = 1,
559		min = 0,
560		max = 1,
561		description = "ECM compatibility.")
562
563	bpy.types.Scene.Scanner = bpy.props.IntProperty(
564		default = 1,
565		min = 0,
566		max = 1,
567		description = "Scanner compatibility.")
568
569	bpy.types.Scene.Radarmapper = bpy.props.IntProperty(
570		default = 1,
571		min = 0,
572		max = 1,
573		description = "Radar mapper compatibility.")
574
575	bpy.types.Scene.Hypercloud = bpy.props.IntProperty(
576		default = 1,
577		min = 0,
578		max = 1,
579		description = "Hypercloud analyzer compatibility.")
580
581	bpy.types.Scene.Sensor = bpy.props.IntProperty(
582		default = 8,
583		min = 0,
584		max = 50,
585		description = "Sensor mount - currently not in use")
586
587	bpy.types.Scene.Autorepair = bpy.props.IntProperty(
588		default = 1,
589		min = 0,
590		max = 1,
591		description = "Hull Autorepair sys compatibility.")
592
593	bpy.types.Scene.Energybooster = bpy.props.IntProperty(
594		default = 1,
595		min = 0,
596		max = 1,
597		description = "Energy booster compatibility.")
598
599	bpy.types.Scene.Atmoshield = bpy.props.IntProperty(
600		default = 1,
601		min = 0,
602		max = 1,
603		description = "Atmospheric shielding compatibility. Ships without it can't land or be bought on surface bases")
604
605	bpy.types.Scene.Cabin = bpy.props.IntProperty(
606		default = 50,
607		min = 0,
608		max = 50,
609		description = "Passenger cabin compatibility and max amount.")
610
611	bpy.types.Scene.Shield = bpy.props.IntProperty(
612		default = 9999,
613		min = 0,
614		max = 9999,
615		description = "Shield compatibility and max amount.")
616
617	bpy.types.Scene.Lasercooler = bpy.props.IntProperty(
618		default = 1,
619		min = 0,
620		max = 1,
621		description = "Laser cooling booster compatibility.")
622
623	bpy.types.Scene.Cargolifesupport = bpy.props.IntProperty(
624		default = 1,
625		min = 0,
626		max = 1,
627		description = "Cargo bay life support compatibility.")
628
629	bpy.types.Scene.Autopilot = bpy.props.IntProperty(
630		default = 1,
631		min = 0,
632		max = 1,
633		description = "Autopilot compatibility.")
634
635	bpy.types.Scene.Tradecomp = bpy.props.IntProperty(
636		default = 1,
637		min = 0,
638		max = 1,
639		description = "Trade analyzer.")
640
641
642def unregister():
643	bpy.utils.unregister_class(ShipPlanner)
644	del bpy.types.Scene.ShipName
645	del bpy.types.Scene.ModelName
646	del bpy.types.Scene.ManufacturerName
647	del bpy.types.Scene.ShipClass
648	del bpy.types.Scene.Price
649	del bpy.types.Scene.HullMass
650	del bpy.types.Scene.FuelMass
651	del bpy.types.Scene.Capacity
652	del bpy.types.Scene.CargoCap
653	del bpy.types.Scene.FWD
654	del bpy.types.Scene.BWD
655	del bpy.types.Scene.UP
656	del bpy.types.Scene.DWN
657	del bpy.types.Scene.LEFT
658	del bpy.types.Scene.RIGHT
659	del bpy.types.Scene.ANG
660	del bpy.types.Scene.EV
661	del bpy.types.Scene.Hyperdrive
662	del bpy.types.Scene.Max_engine
663	del bpy.types.Scene.Max_laser
664	del bpy.types.Scene.Max_missile
665	del bpy.types.Scene.Fuelscoop
666	del bpy.types.Scene.Cargoscoop
667	del bpy.types.Scene.Max_ecm
668	del bpy.types.Scene.Scanner
669	del bpy.types.Scene.Radarmapper
670	del bpy.types.Scene.Hypercloud
671	del bpy.types.Scene.Autorepair
672	del bpy.types.Scene.Energybooster
673	del bpy.types.Scene.Atmoshield
674	del bpy.types.Scene.Cabin
675	del bpy.types.Scene.Shield
676	del bpy.types.Scene.Lasercooler
677	del bpy.types.Scene.Cargolifesupport
678	del bpy.types.Scene.Autopilot
679
680
681if __name__ == "__main__":
682	register()