STK-BLENDER
#15
For nitro export, do we need to adjust and handle the case where there is only 1 nitro, to automatically add the second one???

Code:
def saveNitroEmitter(self, f, lNitroEmitter, path):     if len(lNitroEmitter) > 2:         self.report({'WARNING'}, " %d nitro emitter specified. Up to 2 are allowed." % len(lNitroEmitter))         return     if len(lNitroEmitter) > 0:         f.write('  <nitro-emitter>\n')         letters = ['a', 'b']         for i, nitro in enumerate(lNitroEmitter):  # i is object index             f.write('    <nitro-emitter-%s position = "%f %f %f" />\n' \                     % (letters[i], nitro.location.x, nitro.location.z, nitro.location.y))             if i == 1:                 f.write('  </nitro-emitter>\n')     if len(lNitroEmitter) == 1:         f.write('    <nitro-emitter-b position = "%f %f %f" />\n' \                     % (lNitroEmitter[0].location.x, lNitroEmitter[0].location.z, lNitroEmitter[0].location.y))         f.write('  </nitro-emitter>\n')

or perhaps we will only be able to have one ???

Code:
def saveNitroEmitter(self, f, lNitroEmitter, path):     if len(lNitroEmitter) > 2:         self.report({'WARNING'}, " %d nitro emitter specified. Up to 2 are allowed." % len(lNitroEmitter))         return     if len(lNitroEmitter) > 0:     f.write('  <nitro-emitter>\n')     f.write('    <nitro-emitter-a position = "%f %f %f" />\n' \             % (lNitroEmitter[0].location.x, lNitroEmitter[0].location.z, lNitroEmitter[0].location.y))     f.write('    <nitro-emitter-b position = "%f %f %f" />\n' \             % (lNitroEmitter[1].location.x, lNitroEmitter[1].location.z, lNitroEmitter[1].location.y))     f.write('  </nitro-emitter>\n')     else:         f.write('  <nitro-emitter>\n')     f.write('    <nitro-emitter-a position = "%f %f %f" />\n' \             % (lNitroEmitter[0].location.x, lNitroEmitter[0].location.z, lNitroEmitter[0].location.y))     f.write('  </nitro-emitter>\n')
Reply


Messages In This Thread
STK-BLENDER - by LLS - 01-12-2025, 09:38 PM
zip addon - by LLS - 07-01-2026, 05:55 PM
RE: STK-BLENDER - by kadajett - 10-01-2026, 04:24 PM
RE: STK-BLENDER - by LLS - 10-01-2026, 05:59 PM
RE: STK-BLENDER - by Alayan - 14-01-2026, 10:08 PM
RE: STK-BLENDER - by phax - 14-01-2026, 10:42 PM
RE: STK-BLENDER - by LLS - 04-02-2026, 02:56 AM
RE: STK-BLENDER - by LLS - 18-02-2026, 11:31 PM
RE: STK-BLENDER - by LLS - 10-04-2026, 12:25 AM
RE: STK-BLENDER - by Alayan - 10-04-2026, 02:46 PM
RE: STK-BLENDER - by LLS - 16-04-2026, 04:32 AM
RE: STK-BLENDER - by LLS - 07-05-2026, 04:58 AM
RE: STK-BLENDER - by LLS - 11-05-2026, 01:56 AM
RE: STK-BLENDER - by Alayan - 11-05-2026, 09:17 PM
RE: STK-BLENDER - by LLS - 15-05-2026, 06:50 PM
RE: STK-BLENDER - by Alayan - 15-05-2026, 07:30 PM
RE: STK-BLENDER - by LLS - 16-05-2026, 03:01 AM
RE: STK-BLENDER - by Alayan - 16-05-2026, 03:31 PM
RE: STK-BLENDER - by LLS - 16-05-2026, 04:01 PM
RE: STK-BLENDER - by Alayan - 17-05-2026, 03:19 PM
RE: STK-BLENDER - by LLS - 18-05-2026, 06:44 PM
RE: STK-BLENDER - by Sven - 19-05-2026, 09:56 AM
RE: STK-BLENDER - by LLS - 19-05-2026, 08:19 PM
RE: STK-BLENDER - by LLS - 20-05-2026, 06:22 PM
RE: STK-BLENDER - by LLS - 21-05-2026, 03:51 PM
RE: STK-BLENDER - by LLS - 23-05-2026, 06:47 PM
RE: STK-BLENDER - by ZAQraven - 25-06-2026, 11:52 PM
RE: STK-BLENDER - by LLS - 26-06-2026, 04:17 AM
RE: STK-BLENDER - by Sven - 26-06-2026, 10:19 AM
RE: STK-BLENDER - by LLS - 26-06-2026, 02:06 PM
RE: STK-BLENDER - by LLS - 26-06-2026, 07:01 PM
RE: STK-BLENDER - by Alayan - 26-06-2026, 09:45 PM
RE: STK-BLENDER - by LLS - 26-06-2026, 10:47 PM
RE: STK-BLENDER - by LLS - 27-06-2026, 02:43 AM
RE: STK-BLENDER - by LLS - 27-06-2026, 08:49 PM
RE: STK-BLENDER - by LLS - 28-06-2026, 03:18 AM
RE: STK-BLENDER - by LLS - 16-08-2026, 07:09 PM
RE: STK-BLENDER - by LLS - 23-08-2026, 05:49 PM
RE: STK-BLENDER - by LLS - 15-09-2026, 05:10 PM
RE: STK-BLENDER - by LLS - 26-09-2026, 04:04 PM

Forum Jump: