Customizable Player Models (Fabric)

Customizable Player Models (Fabric)

287k Downloads

How did .cpmmodel encrypted?

none283 opened this issue ยท 2 comments

commented

.cpmproject is .zip, how about .cpmmodel? I want to view .cpmmodel in format that can read

Cause i tried to use your API to export a .cpmproject by code
class.txt

I almost got it, but some part not right so the skin didn't exported and the skin is black when used it (The animations, the models all good, only skin not imported)

What did exported using CPM normal way
Screenshot 2023-03-04 184822

What am trying to do (load .cpmproject, and export into a .cpmmodel file by CPM API with my mod)
Screenshot 2023-03-04 184807

commented

Please learn Java before making addons!

You have the wrong event.
Please don't change the players' models without some user interaction.
You don't need half of the code in the class.
Use editor.load(file) and Exporter.exportModel(...).
Also use the EditorGui instance for editor.frame.
You can create a GuiImpl class instead of implementing IGui, or copy a headless implementation like this: BBGui.java (You have to change the openURL0, i18nFormat method)
The exporter won't work on dedicated servers, CPM can't load or save image files.
You are exporting before the load is finished, use the returned CompletableFuture.

commented

Please learn Java before making addons!

You have the wrong event. Please don't change the players' models without some user interaction. You don't need half of the code in the class. Use editor.load(file) and Exporter.exportModel(...). Also use the EditorGui instance for editor.frame. You can create a GuiImpl class instead of implementing IGui, or copy a headless implementation like this: BBGui.java (You have to change the openURL0, i18nFormat method) The exporter won't work on dedicated servers, CPM can't load or save image files. You are exporting before the load is finished, use the returned CompletableFuture.

Thank you for help, i editted and use CompletableFuture like you said, but it seem failed when load .cpmproject? (My .cpmproject file is good and loaded success in normal)
none_core_player_model_0.3_anims.zip

My code edited:
class.txt

It throw Cannot assign field \"scale\" Error when i tried to change into new .cpmmodel generated by code
log.txt

Any idea about it?