Fix .ski Scripts for Blender need (Python programmer help)

Experienced Elementalist
Joined
Jun 11, 2012
Messages
238
Reaction score
114
Hello guys, I noticed that you cant Export Weapons or Objects in to blender, cuz the script is actualy incomplete,

it does import the object but it drops the 4 bytes data, (Vertex Group)

Inside the script, it got the .bon data from armor / characters / mobs,

But it miss the: Vertex Groups:

Code:
 pwSki_ReadMesh(file_object, vertex_type, material_objects, extra_mat_params, texture_objects, bone_names, xcount):
    name_len = struct.unpack('<I', file_object.read(4))[0]
    ob_name = file_object.read(name_len)
    
    texture_index = struct.unpack('<i', file_object.read(4))[0]		# "signed" long (32 bit)
    material_index = struct.unpack('<i', file_object.read(4))[0]	# "signed" long (32 bit)
    
    # (assignments later below)
    
    if vertex_type == 1:
        file_object.seek(4, 1)
        print "vertex_type=1, skipping 4 bytes"
		
    vertex_count = struct.unpack('<I', file_object.read(4))[0]
    print "vertex_count:",vertex_count
    
    index_count = struct.unpack('<I', file_object.read(4))[0]
    print "index_count(num_faces*3):",index_count
    
    mesh_object = Blender.Object.New('Mesh', ob_name)
    
    mesh = mesh_object.getData(mesh = True)
    
    if mesh is None:
        mesh = Blender.Mesh.New(mesh_name)
        mesh_object.link(mesh)


as you check in here it says:

Code:
   if vertex_type == 1:
        file_object.seek(4, 1)
        print "vertex_type=1, skipping 4 bytes"

It miss the .bon vertex group information that should be for a forge pot in example:

group 1 =Object02

group 2 =Object02_AnimJoint

group 3 = HH_fx01

since the script doesnt read that information, it drop that 4 bytes info, from the .ski, you cant export it back into .ski file,



it should be like the ones it works like armor and stuff example:

Code:
# (only available for vertex_type 0)
    if vertex_type == 1:
        arti_grp1_name = "Articular_W1"
        arti_grp2_name = "Articular_W2"
        arti_grp3_name = "Articular_W3"
        mesh.addVertGroup(arti_grp1_name)
        mesh.addVertGroup(arti_grp2_name)
        mesh.addVertGroup(arti_grp3_name)


Notice that Articular_W1, 2 and 3, are Vertex Groups, in .bon file,

and they are previously declared in the file.

Code:
gSki_HumanFBoneNames = ['Bip01',				# index 0	+
                        'Bip01 Pelvis',			# 01		+
                        'Bip01 Spine',			# 02		+
                        'Bip01 Spine1',			# 03		+
                        'Bip01 Spine2',			# 04		+
                        'Bip01 Neck',			# 05		+
                        'Bip01 Head',			# 06		+
                        'Bip01 Ponytail1',		# 07		+
                        'Bip01 Ponytail11',		# 08		+
                        'Bip01 Ponytail12',		# 09		+



so happens that info of objects and weapons (vertex group) are being skipped, there should add the groups names inside .bon for weapon / objects,

and fix vertex type == 0 code in both import / export, that would make us able to create

Custom Weapons / Objects,

Since I m asking for help, to fix this code,

I promises to public release all my custom weapons / objects that come out from it =)

lets put our heads together its not a complicated script to fix, its just I m a C++ programmer >.<

it would be awsome to be able to export weapons / objects
 
你的 SKI 脚本修好了没?我没有看到你分享的内容。
 
Back