Project forums > Team Avalanche

SpooX Walkmesh exporter alias ShinraTool

<< < (3/6) > >>

SpooX:

--- Quote from: Hellbringer616 on 2012-11-27 19:19:41 ---Well SpooX i offer my computer as a render farm for you as well. Case you run into something you can't do. But your Quatro is designed for that. So hell, it might be better then my desktop card haha

--- End quote ---
thanx for the offer, but I use my laptop mostly for modeling....


--- Quote from: Timu Sumisu on 2012-11-27 19:29:04 ---I should get this working to make blender scripts!

--- End quote ---

try this as a test:

--- Code: ---# -------------------------------------------------------------------
# EALS_1 walkmesh (and cam) Blender Python script generated by SpooX
# -------------------------------------------------------------------
import bpy
import math


def clearScene():
    #clear scene of all objects
    bpy.ops.object.select_all(action='SELECT')
    bpy.ops.object.delete() 
def createMesh(name, verts, edges, faces):
    me = bpy.data.meshes.new(name+'Mesh')
    ob = bpy.data.objects.new(name, me)
    ob.show_name = True
    bpy.context.scene.objects.link(ob)
    me.from_pydata(verts, edges, faces)
    me.update(calc_edges=True)
    return ob

def putCamTarget():
    # Create Empty as target
    bpy.ops.object.add(type='EMPTY', location=(859.9117,335.7209,155.5186))
    bpy.context.active_object.name = 'CamTarget'
def putCam():
    # Create a camera and get the shape name.
    data = bpy.data.cameras.new('EALS_1Cam')
    vcam = bpy.data.objects.new('EALS_1Cam', data)
    vcam.location = (937.4153,-3487.447,1835.102)
    vcam.scale = (1.0, 1.0, 1.0)
    #data.angle_x = 30.0336
    data.lens = 65.2343812616088
    data.draw_size = 100
    data.clip_end = 10000.0
    data.sensor_width = 35.0
    bpy.context.scene.objects.link(vcam)

def addTrackToConstraint(cam, name, target):
    cns = cam.constraints.new('TRACK_TO')
    print(dir(cns))
    cns.name = name
    cns.target = target
    cns.track_axis = 'TRACK_NEGATIVE_Z'
    cns.up_axis = 'UP_Y'
    cns.owner_space = 'LOCAL'
    cns.target_space = 'LOCAL'
def run():
    verts1 = (
    (825.0,-276.0,116.0),
    (791.0,-369.0,116.0),
    (707.0,-302.0,116.0),
    (651.0,-138.0,116.0),
    (596.0,-221.0,116.0),
    (593.0,-130.0,116.0),
    (803.0,-192.0,116.0),
    (772.0,-110.0,116.0),
    (807.0,-60.0,116.0),
    (924.0,-151.0,116.0),
    (944.0,-50.0,116.0),
    (1061.0,-188.0,116.0),
    (1155.0,27.0,116.0),
    (997.0,10.0,116.0),
    (1074.0,95.0,116.0),
    (1196.0,-50.0,116.0),
    (1073.0,-217.0,116.0),
    (1251.0,-88.0,116.0),
    (1206.0,-243.0,116.0),
    (1154.0,-264.0,116.0),
    (1102.0,-259.0,116.0),
    (1297.0,-88.0,116.0),
    (1231.0,-293.0,116.0),
    (1364.0,-200.0,116.0),
    (1337.0,-238.0,116.0),
    (1373.0,-77.0,116.0),
    (1399.0,-183.0,116.0),
    (1438.0,-48.0,116.0),
    (1479.0,-165.0,116.0),
    (1539.0,-109.0,116.0),
    (1495.0,23.0,116.0),
    (1601.0,-38.0,116.0),
    (1624.0,87.0,116.0),
    (1462.0,93.0,116.0),
    (1584.0,157.0,116.0),
    (1460.0,246.0,116.0),
    (1392.0,252.0,116.0),
    (1313.0,143.0,116.0),
    (1344.0,314.0,116.0),
    (1294.0,350.0,116.0),
    (1201.0,109.0,116.0),
    (1139.0,333.0,116.0),
    (1114.0,171.0,116.0),
    (977.0,279.0,116.0),
    (1027.0,326.0,130.0),
    (1147.0,486.0,204.0),
    (-392.0,-301.0,0.0),
    (-306.0,26.0,0.0),
    (-7.0,-22.0,0.0),
    (1046.0,501.0,204.0),
    (1178.0,538.0,204.0),
    (1043.0,630.0,204.0),
    (1228.0,537.0,204.0),
    (1218.0,618.0,204.0),
    (1074.0,704.0,204.0),
    (1021.0,656.0,204.0),
    (1234.0,693.0,204.0),
    (1077.0,740.0,204.0),
    (1360.0,779.0,204.0),
    (1039.0,830.0,204.0),
    (1163.0,1115.0,204.0),
    (1460.0,857.0,204.0),
    (1238.0,1145.0,204.0),
    (1501.0,925.0,204.0),
    (1556.0,993.0,204.0),
    (1556.0,1069.0,204.0),
    (1523.0,1147.0,204.0),
    (1261.0,1243.0,204.0),
    (1540.0,1207.0,204.0),
    (1296.0,1289.0,204.0),
    (1542.0,1267.0,204.0),
    (1426.0,1330.0,204.0),
    (914.0,943.0,204.0),
    (903.0,1038.0,204.0),
    (909.0,1135.0,204.0),
    (1094.0,1182.0,204.0),
    (997.0,1278.0,204.0),
    (1103.0,1228.0,204.0),
    (941.0,1322.0,204.0),
    (865.0,1289.0,204.0),
    (764.0,1252.0,204.0),
    (652.0,1185.0,204.0),
    (711.0,1110.0,204.0),
    (583.0,1080.0,204.0),
    (906.0,834.0,204.0),
    (785.0,735.0,204.0),
    (763.0,843.0,204.0),
    (650.0,794.0,204.0),
    (586.0,844.0,204.0),
    (634.0,688.0,204.0),
    (754.0,611.0,204.0),
    (809.0,654.0,204.0),
    (-76.0,-268.0,0.0),
    (563.0,795.0,188.0),
    (591.0,691.0,191.0),
    (521.0,750.0,193.0),
    (474.0,697.0,0.0),
    (544.0,638.0,0.0),
    (457.0,678.0,0.0),
    (524.0,619.0,0.0),
    (346.0,414.0,0.0),
    (440.0,689.0,0.0),
    (27.0,705.0,0.0),
    (162.0,499.0,0.0),
    (330.0,864.0,0.0),
    (473.0,730.0,0.0),
    (85.0,996.0,0.0),
    (204.0,973.0,0.0),
    (401.0,399.0,0.0),
    (492.0,432.0,0.0),
    (541.0,607.0,0.0),
    (639.0,533.0,0.0),
    (557.0,621.0,0.0),
    (652.0,492.0,0.0),
    (530.0,380.0,0.0),
    (650.0,402.0,0.0),
    (623.0,277.0,0.0),
    (503.0,337.0,0.0),
    (461.0,323.0,0.0),
    (592.0,203.0,0.0),
    (426.0,316.0,0.0),
    (407.0,293.0,0.0),
    (526.0,68.0,0.0),
    (389.0,264.0,0.0),
    (370.0,124.0,0.0),
    (313.0,231.0,0.0),
    (469.0,7.0,0.0),
    (356.0,-17.0,0.0),
    (394.0,-61.0,0.0),
    (353.0,-96.0,0.0),
    (334.0,-25.0,0.0),
    (305.0,-39.0,0.0),
    (309.0,-142.0,0.0),
    (273.0,-48.0,0.0),
    (244.0,-62.0,0.0),
    (272.0,-173.0,0.0),
    (194.0,-97.0,0.0),
    (234.0,-238.0,0.0),
    (201.0,-282.0,0.0),
    (124.0,-115.0,0.0),
    (145.0,-304.0,0.0),
    (36.0,-285.0,0.0),
    (310.0,-6.0,23.0),
    (320.0,41.0,0.0),
    (259.0,73.0,0.0),
    (288.0,40.0,0.0),
    (279.0,-2.0,35.0),
    (241.0,11.0,0.0),
    (16.0,-94.0,0.0),
    (102.0,-53.0,0.0),
    (247.0,-18.0,35.0),
    (232.0,-47.0,34.0),
    (162.0,-79.0,13.0),
    (76.0,-18.0,0.0),
    (-30.0,152.0,0.0),
    (188.0,44.0,0.0),
    (200.0,81.0,0.0),
    (38.0,155.0,0.0),
    (220.0,-28.0,30.0),
    (181.0,-45.0,10.0),
    (162.0,-13.0,0.0))

    faces1 = (
    (2,1,0),
    (2,0,3),
    (2,3,4),
    (3,5,4),
    (0,6,3),
    (3,6,7),
    (6,8,7),
    (6,9,8),
    (8,9,10),
    (9,11,10),
    (10,11,12),
    (10,12,13),
    (12,14,13),
    (11,15,12),
    (11,16,15),
    (15,16,17),
    (16,18,17),
    (16,19,18),
    (16,20,19),
    (17,18,21),
    (18,22,21),
    (21,22,23),
    (22,24,23),
    (21,23,25),
    (23,26,25),
    (25,26,27),
    (26,28,27),
    (27,28,29),
    (27,29,30),
    (29,31,30),
    (30,31,32),
    (30,32,33),
    (32,34,33),
    (33,34,35),
    (33,35,36),
    (33,36,37),
    (36,38,37),
    (37,38,39),
    (37,39,40),
    (39,41,40),
    (40,41,42),
    (40,42,14),
    (40,14,12),
    (41,43,42),
    (41,44,43),
    (41,45,44),
    (48,47,46),
    (45,49,44),
    (45,50,49),
    (49,50,51),
    (50,52,51),
    (51,52,53),
    (51,53,54),
    (51,54,55),
    (53,56,54),
    (54,56,57),
    (56,58,57),
    (57,58,59),
    (58,60,59),
    (58,61,60),
    (60,61,62),
    (61,63,62),
    (62,63,64),
    (62,64,65),
    (62,65,66),
    (62,66,67),
    (66,68,67),
    (67,68,69),
    (68,70,69),
    (69,70,71),
    (59,60,72),
    (60,73,72),
    (74,73,60),
    (74,60,75),
    (74,75,76),
    (75,77,76),
    (74,76,78),
    (74,78,79),
    (74,79,80),
    (74,80,81),
    (74,81,82),
    (81,83,82),
    (59,72,84),
    (72,85,84),
    (72,86,85),
    (85,86,87),
    (86,88,87),
    (85,87,89),
    (85,89,90),
    (85,90,91),
    (48,46,92),
    (95,94,93),
    (87,88,93),
    (93,94,89),
    (93,89,87),
    (95,96,94),
    (94,96,97),
    (96,98,97),
    (97,98,99),
    (99,98,100),
    (98,101,100),
    (100,101,102),
    (100,102,103),
    (101,104,102),
    (101,105,104),
    (102,104,106),
    (104,107,106),
    (100,108,99),
    (109,99,108),
    (110,99,109),
    (111,110,109),
    (112,110,111),
    (109,113,111),
    (109,114,113),
    (113,114,115),
    (114,116,115),
    (114,117,116),
    (118,116,117),
    (118,119,116),
    (118,120,119),
    (121,119,120),
    (121,122,119),
    (123,122,121),
    (122,123,124),
    (123,125,124),
    (122,124,126),
    (126,124,127),
    (126,127,128),
    (127,129,128),
    (130,129,127),
    (131,129,130),
    (129,131,132),
    (131,133,132),
    (132,133,134),
    (132,134,135),
    (134,136,135),
    (135,136,137),
    (136,138,137),
    (136,139,138),
    (138,139,140),
    (139,141,140),
    (127,142,130),
    (124,144,143),
    (143,144,145),
    (145,144,146),
    (144,147,146),
    (141,139,148),
    (139,149,148),
    (133,150,134),
    (150,151,134),
    (134,151,136),
    (151,152,136),
    (136,152,139),
    (127,124,143),
    (148,149,153),
    (148,153,48),
    (153,154,48),
    (144,156,155),
    (153,157,154),
    (148,48,92),
    (148,92,141),
    (143,142,127),
    (143,145,142),
    (142,145,146),
    (155,158,147),
    (155,147,144),
    (151,158,159),
    (151,159,152),
    (159,149,152),
    (152,149,139),
    (153,149,160),
    (160,158,155),
    (142,131,130),
    (131,142,146),
    (158,150,147),
    (158,151,150),
    (150,146,147),
    (150,133,146),
    (146,133,131),
    (158,160,159),
    (160,149,159))

    clearScene()
    ob1 = createMesh('EALS_1WalkMesh',  verts1, [], faces1)
    putCam()
    putCamTarget()
    cam = bpy.data.objects['EALS_1Cam']
    target = bpy.data.objects['CamTarget']
    addTrackToConstraint(cam,"myTrackTo",target)
    return
if __name__ == "__main__":
    run()

--- End code ---

and let me know what you think (it's EALS_1).
 8)

<edit:removed import mathutils line from the code >

Timu Sumisu:
Just tested all my new computer parts tonight, will have it built in the next few days and can get testing/tweaking on this. At a quicdk go on my laptop, it said mathutils didnt exist >.>

Will have to update my python stuffz.

Note: Said computer is notably awesome, and sweet pics are sure to come!

SpooX:

--- Quote from: Timu Sumisu on 2012-11-28 03:44:32 ---Just tested all my new computer parts tonight, will have it built in the next few days and can get testing/tweaking on this. At a quicdk go on my laptop, it said mathutils didnt exist >.>

Will have to update my python stuffz.

Note: Said computer is notably awesome, and sweet pics are sure to come!

--- End quote ---
oh you can remove the mathutils line, it's just a line which comes from some experimenting with calculations in the script, it runs perfectly without it. In fact the calculations have moved into the exporter.

PS I test these scripts on Blender 2.6 and above.
 8-)

SpooX:
Just a small message to notify that some new export features are added, for details see first post.
 8)

Mayo Master:
I tested your Blender exporter for mds5_i...
It's brilliant! Very easy to use, and great results (and by the way, I accessed the file through disk 2, worked perfectly).
Note for newbie Blender users like me: be mindful about adjusting the camera front and end clipping distances, not only for having the scene viewable at all, but for avoiding z-fighting issues.
Anyway, that sure will make everyone's job so much easier.  ;D  Worth being sticky-ed, in my opinion.
Again, thank you so much!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version