def main():
    showhelp()
    pmx, name = showprompt()
    pmx, is_changed = prune_invalid_faces(pmx)
    if is_changed:
        end(pmx, name)
    core.pause_and_quit("Done with everything! Goodbye!")
Example #2
0
def main():
    showhelp()
    pmx, name = showprompt()
    pmx, is_changed = morph_winnow(pmx, PRINT_AFFECTED_MORPHS)
    if is_changed:
        end(pmx, name)
    core.pause_and_quit("Done with everything! Goodbye!")
def main():
	showhelp()
	pmx, name = showprompt()
	pmx, is_changed = uniquify_names(pmx)
	if is_changed:
		end(pmx, name)
	core.pause_and_quit("Done with everything! Goodbye!")
Example #4
0
def main():
    core.MY_PRINT_FUNC("Specify a VMD file to attempt parsing")
    core.MY_PRINT_FUNC(
        "Because MikuMikuDance pads with garbage, but I pad with zeros, the binary file I write back will not be exactly bitwise identical"
    )
    core.MY_PRINT_FUNC(
        "But I can read the version I wrote and verify that the internal representation matches"
    )
    input_filename = core.prompt_user_filename(".vmd")
    # input_filename = "vmdtest.vmd"
    Z = read_vmd(input_filename)
    write_vmd("____vmdparser_selftest_DELETEME.vmd", Z)
    ZZ = read_vmd("____vmdparser_selftest_DELETEME.vmd")
    core.MY_PRINT_FUNC("")
    bb = core.read_binfile_to_bytes(input_filename)
    bb2 = core.read_binfile_to_bytes("____vmdparser_selftest_DELETEME.vmd")
    core.MY_PRINT_FUNC("Is the binary EXACTLY identical to original?",
                       bb == bb2)
    exact_result = Z == ZZ
    core.MY_PRINT_FUNC("Is the readback EXACTLY identical to original?",
                       exact_result)
    if not exact_result:
        # boneframelist is different!!! but its just floating-point wibblyness caused by the quaternion transform math
        fuzzy_result = core.recursively_compare(Z, ZZ)
        core.MY_PRINT_FUNC("Is the readback ALMOST identical to the original?",
                           not fuzzy_result)
        core.MY_PRINT_FUNC("Max difference between two floats:",
                           core.MAXDIFFERENCE)
        core.MY_PRINT_FUNC(
            "Number of floats that exceed reasonable threshold 0.0005:",
            fuzzy_result)
    core.pause_and_quit("Parsed without error")
Example #5
0
def main():
    core.MY_PRINT_FUNC("Specify a vpd file to attempt parsing")
    input_filename = core.prompt_user_filename(".vpd")
    # input_filename = "vpdtest.vpd"
    Z = read_vpd(input_filename)
    write_vpd("____vpdparser_selftest_DELETEME.vpd", Z)
    ZZ = read_vpd("____vpdparser_selftest_DELETEME.vpd")
    core.MY_PRINT_FUNC("")
    bb = core.read_binfile_to_bytes(input_filename)
    bb2 = core.read_binfile_to_bytes("____vpdparser_selftest_DELETEME.vpd")
    # now compare bb (original binary) with bb2 (read-write)
    # now compare Z (first read) wtih ZZ (read-write-read)
    core.MY_PRINT_FUNC("Is the binary EXACTLY identical to original?",
                       bb == bb2)
    exact_result = Z == ZZ
    core.MY_PRINT_FUNC("Is the readback EXACTLY identical to original?",
                       exact_result)
    if not exact_result:
        # boneframelist is different!!! but its just floating-point wibblyness caused by the quaternion transform math
        fuzzy_result = core.recursively_compare(Z, ZZ)
        core.MY_PRINT_FUNC("Is the readback ALMOST identical to the original?",
                           not fuzzy_result)
        core.MY_PRINT_FUNC("Max difference between two floats:",
                           core.MAXDIFFERENCE)
        core.MY_PRINT_FUNC(
            "Number of floats that exceed reasonable threshold 0.0005:",
            fuzzy_result)
    core.pause_and_quit("Parsed without error")
Example #6
0
def main():
    showhelp()
    pmx, name = showprompt()
    pmx, is_changed = weight_cleanup(pmx)
    if is_changed:
        end(pmx, name)
    core.pause_and_quit("Done with everything! Goodbye!")
Example #7
0
def main():
    showhelp()
    pmx, name = showprompt()
    pmx, is_changed = translate_to_english(pmx, moreinfo=True)
    if is_changed:
        end(pmx, name)
    core.pause_and_quit("Done with everything! Goodbye!")
def main():
    showhelp()
    pmx, name = showprompt()
    pmx, is_changed = prune_unused_bones(pmx, PRINT_FOUND_UNUSED_BONES)
    if is_changed:
        end(pmx, name)
    core.pause_and_quit("Done with everything! Goodbye!")
		# print 'from' with the case/separator it uses in the PMX
		core.MY_PRINT_FUNC("   {:s} --> {:s} | {:s}".format(o, n, s))
		
	core.MY_PRINT_FUNC("Done!")
	return None


if __name__ == '__main__':
	core.MY_PRINT_FUNC("Nuthouse01 - 1/29/2021 - v5.07")
	if DEBUG:
		# print info to explain the purpose of this file
		core.MY_PRINT_FUNC(helptext)
		core.MY_PRINT_FUNC("")
		
		main()
		core.pause_and_quit("Done with everything! Goodbye!")
	else:
		try:
			# print info to explain the purpose of this file
			core.MY_PRINT_FUNC(helptext)
			core.MY_PRINT_FUNC("")
			
			main()
			core.pause_and_quit("Done with everything! Goodbye!")
		except (KeyboardInterrupt, SystemExit):
			# this is normal and expected, do nothing and die normally
			pass
		except Exception as ee:
			# if an unexpected error occurs, catch it and print it and call pause_and_quit so the window stays open for a bit
			core.MY_PRINT_FUNC(ee)
			core.pause_and_quit("ERROR: something truly strange and unexpected has occurred, sorry, good luck figuring out what tho")
        self.verts = verts
        self.faces = faces
        self.textures = texes
        self.materials = mats
        self.bones = bones
        self.morphs = morphs
        self.frames = frames
        self.rigidbodies = rbodies
        self.joints = joints
        self.softbodies = sbodies

    def list(self) -> list:
        return [
            self.header.list(),  #0
            [i.list() for i in self.verts],  #1
            self.faces,  #2
            self.textures,  #3
            [i.list() for i in self.materials],  #4
            [i.list() for i in self.bones],  #5
            [i.list() for i in self.morphs],  #6
            [i.list() for i in self.frames],  #7
            [i.list() for i in self.rigidbodies],  #8
            [i.list() for i in self.joints],  #9
            [i.list() for i in self.softbodies],  #10
        ]


if __name__ == '__main__':
    core.MY_PRINT_FUNC("Nuthouse01 - 10/10/2020 - v5.03")
    core.pause_and_quit("you are not supposed to directly run this file haha")