Giter VIP home page Giter VIP logo

nusiq / mcblend Goto Github PK

View Code? Open in Web Editor NEW
56.0 56.0 5.0 100.26 MB

A Blender 4.2 plugin that allows creators to design and animate Minecraft Bedrock Edition models using Blender's powerful 3D modeling and animation tools.

Home Page: https://mcblend.readthedocs.io

License: MIT License

Python 100.00%
3d addon animations blender minecraft minecraft-bedrock-edition minecraft-models models

mcblend's People

Contributors

7dev7urandom avatar ktar5 avatar maxaxik avatar nusiq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mcblend's Issues

Error when enabling addon

Hey, I downloaded the latest zip file (3.2.0) and installed it in blender. When I wanna enable the addon, I get this error:

image

Add warning when the UV of a face of a cube isn't rectangular.

The exporter currently takes the minimal and maximal UV coordinates of the 4 loops (vertices) of the face. Minecraft saves the uv for a face as two vectors (position and size) but it's possible in blender to move any vertex in any place. The user should be warned that such UV can't be accurately exported to Minecraft format.

Grouping UV maps

Add the option of grouping some of the cubes together so they get the same UV map.

Model improter doesn't accept texture_width and texture_height in non-integer format

Even though the schema for Minecraft model says that the width and height must be an integer, Minecraft still accepts float values (they are probably rounded using floor function). Some of the models from default resource pack have integers written in float format - armor stand uses:

"texture_width" : 64.0,
"texture_height" : 64.0,

Mcblend doesn't allow importing models like that. This should be changed to fit the behavior of Minecraft.

Add option to create armature to imported model

Currently every bone from minecraft model creates an empty with cubes which represent the cubes. It's hard to work with model like that. There will be an option to import model with armature in the future.
image

Change mc_is_bone property type from int to something else

The mc_is_bone property is just a tag that says that the object is a mcbone. Bool values in custom properties are not supported so currently it uses the int value. Changing it to something not editable (empty dictionary, empty list or a pointer) will look better in the GUI. The mc_is_bone will be changed to just an empty dictionary.

Mirror

Add mirror option for UV mapping.

Loop

Add loop option to animations.

Per-face UV-mapping

It turns out that bedrock supports per-face UV-mapping. Support for that should be added.

Toggle mc_mirror returns wrong messages

Toggle mc_mirror returns the oposite message to what it should return. It shows the "Cleared mc_mirror" when the mc_mirror is set to 1 and "Set mc_mirror to 1" when its cleared.

Clone parents

Add an option to use object parenting of exported model into custom parenting which is already implemented in this extension.

Importing doesn't work for UV

Recent rework of UV mapping added option to use per face UV-mapping (and closed #32). Custom property mc_uv isn't used anymore which means that the importing function must be rewritten to use blender uvs instead.

Exporting animations - different OS can give different results

Its not a bug that completly breaks the plugin because the differences are really small but it gives false alarms durign testing with github actions. Ubuntu returns slightly different results than windows even though they run the same version of blender.

image

Inflate

Add support for minecraft model option "inflate".

UV Mapping

Add feature to generate UV mapping for the model to make creating textures for minecraft possible in blender.

Importing default visible bounds of a model

Solving this issue requires solving Issue #46 first. Currently Mcblend doesn't support the concept of visible bounds at all. When this will be implemented the importer should also be able to import models without defined visible bounds. Here are the default values:

  • visible_bounds_width: 1,
  • visible_bounds_height: 1,
  • visible_bounds_offset: [0, 0, 0]

Animation rotation bug

The addon internally works with quaternions but Minecraft models store rotation as Euler models. Euler angles can represent the same rotation in multiple ways which can cause problems during the interpolation between two frames of animation. The solution to this problem is in src/operator_func/common.py:pick_closest_rotation function. It looks through equivalent Euler angles and tries to pick the one which is represented by a vector as close as possible to the previous rotation.

The function tries to find the equivalent rotations in two ways:

  1. Adding/removing 360 to one of the axes (which works fine).
  2. Applying transformation f(v) = [x, y, z] --> [x + 180, -(y + 180), z + 180]
    and the combinations of these two.

The second way of getting the equivalent rotation sometimes return unexpected results. It's hard to illustrate that because these unexpected results are usually replaced by a better (closer) rotation created by method 1 but after some testing I created an example. It looks like additional correction is necessary for the converter to work properly.

The problem is caused by original rotation (before animation) of the bone. Only the Y-axis affects the results. It's especially conspicuous when original rotation why gets close to (90+(n*180). Adding 2 * original_Y to the Y value of the rotation after f(v) transformation fixes the problem (for cases tested so far).

Problem ilustraded in Blockbench:

  1. The model - original Y-rotation is -45
    obraz
  2. Some random rotation in the 1st keyframe
    obraz
  3. Rotation after transformation and a correction Y-90
    obraz
  4. Rotation after the transformation but without the correction.
    obraz

Automate testing

Automate testing. You can run scripts in blender in background with ./blender.exe -b -P "path/to/your/file.py"

Exporter does't use standard Minecraft UV-mapping format when it's possible.

Recent rework of UV mapping added option to use per face UV-mapping (and closed #32). The Positions of the textures are still placed as in the default minecraft cube UV but the exporter always uses the sytax for mapping each face separately.

The 'mc_uv' custom property is not used anymore. The exporter uses the UV coordinates from UV-map in blender. The exporter should be able to tell if the UV coordinates matches the shape used by default UV.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.