Coder Social home page Coder Social logo

menithal / blender-metaverse-addon Goto Github PK

View Code? Open in Web Editor NEW
67.0 11.0 37.0 931 KB

Blender toolset for creating content for Metaverses like High Fidelity

License: GNU General Public License v3.0

Python 100.00%
blender python bpy hifi addon blender-addon blender-script high-fidelity-addon high-fidelity-tool metaverse-tool

blender-metaverse-addon's Introduction

Blender Metaverse Toolkit Blender Add-on (MVT) AddOn

Plugin ("Project Hermes") is a plugin for Blender to allow for easier content creation originally created for importing for the High Fidelity Metaverse Platform.

It has now being expanded to support additional platforms. as the official High Fidelity platform is turning off, while its forks are going to live their separate lives. This plugin now will focus on supporting as many platforms as possible.

Currently Supports

  • HiFi and Forks
  • VRC (NeosVR by Proxy)
  • Tower Unite
  • Faceshift/Animaze

3.1+ Works with blender 2.90 or later.

Installation Guide

Simple

Open the Github page, go to releases and download the metaverse_tools.zip zip file.

In Blender. Goto User Preferences, and Add-ons. From there Install Add-on from File and select the Zip file that we downloaded.

Enable the plugin under Import-Export: Metaverse Toolkit Blender Add-on.

If you had previous used plugin when it was "High Fidelity" Only, make sure to uninstall the old one first.

If you use the git repository:

Make sure to git submodule init and git submodule update as we are using an external add on to bind shapekeys to new model.

Copy metaverse_tools folder to your Blender Addons Directory.

On Windows this is under %APPDATA%/Blender Foundation/Blender/<BlenderVersion>/addons

Utility Functions:

General Tools

  • Material Tools
    • Automatic Principled BDSF binding to HF FBX. You can use Blender materials to define HF materials, just do not use Node Groups.
    • Set Non-Diffuse ColorData and Auto Correct on Save Tools that fixes color spaces for Roughness, Normal, and Metallic textures for preview
    • Textures to Mask and Textures to Png utility helpers.
  • Mesh Tools:
    • Merge Modifiers & Shapekeys attempt to merge modifiers onto Mesh with Shapekeys using Przemysław Bągard's ApplyModifierForObjectWithShapeKeys script, now included with this plugin, but if an existing copy exists, it is used instead
    • Clean Unused Vertex Groups Clean model from vertex groups that are not in its current skeleton.
  • Armature Tools:
    • Test Avatar Rest Pose - Attempts to detect type of skeleton and applies an absolute T-Pose by the platform reference
    • Merge Bones - Attempts to merge selected bones to last selected bone.
    • Match Reference Rolls - Uses rolls from the detected reference skeleton.

High Fidelity Tools

Generic Toolset allowing one to create content for High Fidelity forks, from

  • A new Panel on the 3D View's right tool set is added, labled MVT: High Fidelity
  • Armature Tools
    • Add Hifi Armature - Adds an Armature which is compatible with High Fidelity forks, has all the naming conventions in place
    • Set Bone Physical - (Armature Edit mode only) Adds a prefix to selected bones for Scripts in High fidelity for physical simulation
    • Remove Bone Physical - (Armature Edit mode only) Removes prefix from selected bones for Scripts in High fidelity for physical simulation
  • Avatar Converters
    • Custom Avatar - Attempts to bind of the model to a HF specific Bone naming and rotations.
    • MMD Avatar - Translates and fixes MMD models and their materials for them to work in High Fidelity. Full MMD Avatar import tutorial here

Hifi Export Tools:

  • File > Export > Hifi FBX: Custom FBX that binds to the Principled BDSF into a format HiFi understands
  • File > Export > Hifi Avatar FST: Exports Avatar, applies necessary steps for avatar to work in High Fifelity.
    • Supports Embedded textures: Exports Textures embedded to file
    • Supports Selected Only: Exports Selected only
    • Experimental Oven Feature: Experimental feature to Compress Avatar and its Textures: Only settable if you have set the path under User Settings > Addon > HiFi Blender Add-on
  • File > Export > HiFi Metaverse Scene JSON/FBX: Exports Scene as a json and Fbx
    • Marketplace / Base URL : This is the folder path for your marketplace or external server address. Simply paste the directory where you will upload the files here, and the json file will have the urls automatically appended to them. This is not optional and must be set prior to exporting: You will otherwise have an error message
    • Clone Scene prior to export

Importing from Hifi:

The add-on allows you to import primitive entities from High Fidelity. In High Fidelity, select the entities you want to export and press export.

In Blender, You can then import these entities with File > Import > HiFi Metaverse Scene JSON

You can then set materials to the objects via the material panel, modify the mesh, do uv mapping corrections.

Hifi Import Settings

  • Use UV Sphere: Instead of a Quad sphere, use a UV sphere for the base primitive
  • Join Mesh Children: If Boolean is set to None, join Children with their Parents into a Single Mesh
  • Merge Distance: Set this higher if you want to remove doubles
  • Delete interior faces: If the mesh is enclosed and not consisting of multiple convex intercepting shapes, delete interior walls
  • Boolean: Experimental feature to enable
    • None: Use no boolean solver to solve for faces
    • BMesh: Experimental: Use BMesh solver to solve for mesh
    • Carve: Experimental Use Carge solver to solve for mesh

If Entity is not Child of another entity, no Join is done. Only Children are merged with their Parents

Note that Boolean operations work differently, and some may not keep the UV Unwrapping correctly in some situations. Use at your own risk

VRChat / Neos Tools (WIP)

Work in progress module to try to stream line some "gotchas" when converting avatars to VRC without the duplicate operator additions from CATS (creating operators for Tools that are already in Blender, which create abit of clutter during operator searches). Also by proxy supports NeosVR, which automatically binds the visemes when fbx export is used.

  • A new Panel on the 3D View's right tool set is added, labeled MVT: VRC Tools
  • Armature Tools
    • Add VRC Armature - Adds an Armature which is compatible with VRC
    • Generate VRC Shapekeys - Generates empty shapekeys (for now, later will allow the use of various methods, including CATS, and custom)
    • Sort Shapekeys - Utility function to quickly sort shapekeys to match VRC requirements.

Tower Unite Tools (WIP)

Work in progress module to try to stream line some "gotchas" when converting avatars to TE.

  • A new Panel on the 3D View's right tool set is added, labeled MVT: TowerUnite Tools
  • Armature Tools
    • Add TU Armature - Adds an Armature which is compatible with Tower Unite
    • Clean Shapekeys - Utility function to quickly remove all shapekeys from a model
    • Fix Common Issues - Utility function to remove all weights for root, and all the twist bones that tend to cause issues.

Generic Rigging tools:

Mostly Tools for assisting with creating rigs for animations into various platforms and engines.

  • Pose Contraint tools:

    • Clear Constraint - Allows fast clearing of constraints
    • Location Copy - Sets up Pose Location Constraint for selected bones to copy the root
    • Influenced Copy - Sets up a Pose Location constraint for selected bones with influence based on distance to active
    • Rotational Copy - Sets up a Pose Rotation constraints for selected bones to copy the root
    • Mirror Constraint - Copies all Constraints from other bones, and mirrors it to the other side.
    • Normalize Constraints - Normalizes influences for a bone with multiple constraints of the same type.
  • Pose Utility Tools:

    • Clone Locks - Clones position and rotation locks from one bone to the other
    • Un/Lock Rotations - Locks all rotations for bone
    • Un/lock Translations - Unlocks all Translations
    • Copy Custom Shapes - Copies custom bone shapes from one to selected.
    • Clear Custom Shapes - Clears all custom bone shapes.

Changelog:

3.1.0

  • Added Facerig/Animaze Bundle export - Creates a folder structure that is compatible with animaze/facerig
  • Hifi->Vircadia rename
  • Split Mirrorable Actions Mirror Actions into Actions allowing creation of mirrored actions
  • Using latest Apply Modifiers version for better Blender 2.90+ compatability

2.1.0

  • Added Hotfix #29 and #28 Relating to Hifi FBX and the FBX changes in 2.8
  • Added Pose Constraint Tools for dealing with bone constraints
  • Added Pose Utility Tools for dealing with bone behavior

2.0.1

  • Added some sculpting tools to quickly add 0.05 and reduce 0.05 resolution prior to remesh
  • Moved compartmentalized components around for more easier maintenance in the future.
  • README improvements

2.0

  • hifi_tools is now metaverse_tools
  • Added Tower Unite specific tools
  • Fixed 2.81 FBX export (but may have forgotten 2.8)

1.5.5

  • Hifi_tools is in the process of renaming to mvt_tools, in version 2.0 this will occur
  • Added VRChat Specific tools (WIP) for experienced blenderers.
  • Prepared framework for ability to import and on-the-fly create multiple platform skeletons and retarget animations cross-platform.
  • Fixed issues with Hifi FBX export, regarding emissions

1.4x

  • 2.8 RC support
  • Removed eBPBRS infavor of just using the PBR Materials.
  • Lots of Refactoring

blender-metaverse-addon's People

Contributors

humbletim avatar kant avatar ksuprynowicz avatar marcusllewellyn avatar menithal avatar roxanneskelly 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blender-metaverse-addon's Issues

"hifi" fbx export broken again

Sorry to say that the import/export system changed again in Blender 1.82 (release) so the HIFI fbx export broke, the options part is missing from the dialog (like path mode etc.).
Clicking export just throws a ton of exceptions.

Errors when importing HF jsons into blender 2.81

Traceback (most recent call last):
File "C:\Users\benbr\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\metaverse_tools\files\hifi_json\operator.py", line 187, in execute
return load_file(self, context, **keywords)
File "C:\Users\benbr\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\metaverse_tools\files\hifi_json\loader.py", line 39, in load_file
scene = HifiScene(data, uv_sphere, join_children, merge_distance, delete_interior_faces, use_boolean_operation)
File "C:\Users\benbr\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\metaverse_tools\hifi_world\scene.py", line 58, in init
hifi_entity = HifiObject(entity, self)
File "C:\Users\benbr\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\metaverse_tools\hifi_world\scene.py", line 177, in init
(color['red'], color['green'], color['blue']))
File "C:\Users\benbr\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\metaverse_tools\hifi_world\scene.py", line 121, in append_material
mat.diffuse_color = tuple(c/255 for c in color)
ValueError: bpy_struct: item.attr = val: sequences of dimension 0 should contain 4 items, not 3

location: :-1

'Set Bone Physical' bone renaming truncates the name

I have a model I'm preparing to turn into a HiFi avatar. The hair joints are named 'hair 0', 'hair 1', 'hair 2', etc. However, selecting them and clicking 'set bone physical' renames them to 'sim0', 'sim1', etc. It would appear the addon is truncating spaced bone names and assigning them a number instead. This is not only vague, but problematic, because if I want to set bone physical to other bones with similar names, I'll get 'sim1.001', 'sim2.001', etc.

My recommendation is to strip spaces and/or use regex for this, perhaps.

Albedo defaults to white, even with no albedo texture

on "hifi FBX" export the albedo /Base Color value defaults to white (1,1,1) even if there is no albedo texture plugged in. I know this is part of the effort to prevent accidental tinting but is should really only do this if a texture is plugged in.
Personally, I would like for this to be an optional feature because I ability to tint a texture this way quite useful.

plugin V1.5.5
Blender 2.80
hifi 0.86.0

ATP error when no ATP option selected

Using version 0.4.5 - exporting a test avatar.

Modules Installed from 'C:\\Users\\OrangeTwo\\Downloads\\Blender-Hifi-Addon-master(3).zip' into 'C:\\Users\\OrangeTwo\\AppData\\Roaming\\Blender Foundation\\Blender\\2.78\\scripts\\addons' ()
Traceback (most recent call last):
  File "C:\Users\OrangeTwo\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\Blender-Hifi-Addon-master\hifi_json_writer.py", line 399, in execute
    if self.clone_scene:
Exception: You must Use ATP or Set the Marketplace / base URL to make sure that the content can be reached after you upload it. ATP currently not supported

location: <unknown location>:-1

Traceback (most recent call last):
  File "C:\Users\OrangeTwo\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\Blender-Hifi-Addon-master\hifi_json_writer.py", line 399, in execute
    if self.clone_scene:
Exception: You must Use ATP or Set the Marketplace / base URL to make sure that the content can be reached after you upload it. ATP currently not supported

location: <unknown location>:-1

These are my export options:
image

Opacity value & Emission value does not export

Opacity and Emission value does not apply When using hifi fbx export.
Using maps work but not values, maybe they are being clamped to default?
For opacity at least, I suggest not not forcing value to default, even when a map is supplied because in some situations, like using blended alpha, “hifi” requires the opacity to be <1 for it to work. Maybe make the value override an option like color space correction is now.

XPS import?

XNALara is a popular format, most noticeably on DeviantArt. It's not as popular as MMD, but it's still in wide use. There exists a Blender import add-on for files, so I'm wondering if Hifi tools can specialise the import?

Existing import addon is at https://www.deviantart.com/johnzero7/ plus the guy has some XPS models favorited.

no "hifi FBX" export in blender 2.81a

after upgrading to current stable (2.81a) hifi FBX export no longer works for me.

Traceback (most recent call last):
  File "C:\Users\Silverfish\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\hifi_tools\ext\modified_fbx_tools\__init__.py", line 360, in execute
    return mod_export_fbx_bin.save(self, context, **keywords)
  File "C:\Users\Silverfish\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\hifi_tools\ext\modified_fbx_tools\mod_export_fbx_bin.py", line 1041, in save
    ret = save_single(operator, context.scene, depsgraph, filepath, **kwargs_mod)
  File "C:\Users\Silverfish\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\hifi_tools\ext\modified_fbx_tools\mod_export_fbx_bin.py", line 953, in save_single
    False, media_settings, use_custom_props,
TypeError: __new__() missing 1 required positional argument: 'use_custom_props'

location: <unknown location>:-1

Error with newest plugin ver

Traceback (most recent call last):
  File "C:\Users\OrangeTwo\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\Blender-Hifi-Addon-master\hifi_json_writer.py", line 409, in execute
    bpy.ops.object.select_all(action = 'DESELECT')
  File "C:\Program Files\Blender Foundation\Blender\2.78\scripts\modules\bpy\ops.py", line 189, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.select_all.poll() failed, context is incorrect

location: <unknown location>:-1

Attempting to export a simple blender shape

Make all paths absolute

Blender fbx seems to hava an issue corrrectly locating textures
If you use File External data-make all paths absolute before exporting the Fbx
it corrects the links and then assigns the textures correctly

Extra feature for the fix everything button?

Error when converting MMD armature to HiFi

When converting an MMD armature to HiFi, the plugins finishes most of the work but throws an error:

Python: Traceback (most recent call last):
  File "/home/motofckr9k/.config/blender/2.91/scripts/addons/metaverse_tools/ui/modules/hifi.py", line 105, in execute
    mmd.convert_mmd_avatar_hifi()
  File "/home/motofckr9k/.config/blender/2.91/scripts/addons/metaverse_tools/utils/bones/mmd.py", line 469, in convert_mmd_avatar_hifi
    convert_bones(Translator, obj)
  File "/home/motofckr9k/.config/blender/2.91/scripts/addons/metaverse_tools/utils/bones/mmd.py", line 316, in convert_bones
    clean_up_bones(obj)
  File "/home/motofckr9k/.config/blender/2.91/scripts/addons/metaverse_tools/utils/bones/mmd.py", line 294, in clean_up_bones
    spine.select_set(state=True)
AttributeError: 'EditBone' object has no attribute 'select_set'

location: <unknown location>:-1

[Linux] AttributeError: Calling operator "bpy.ops.wm.console_toggle" error, could not be found

Traceback (most recent call last):
File "/home/source/.config/blender/2.79/scripts/addons/hifi_tools/utils/custom.py", line 397, in execute
return rename_bones_and_fix_most_things(self, context)
File "/home/source/.config/blender/2.79/scripts/addons/hifi_tools/utils/custom.py", line 195, in rename_bones_and_fix_most_things
bpy.ops.wm.console_toggle()
File "/home/source/Blender/blender-2.79b-linux-glibc219-x86_64/2.79/scripts/modules/bpy/ops.py", line 189, in call
ret = op_call(self.idname_py(), None, kw)
AttributeError: Calling operator "bpy.ops.wm.console_toggle" error, could not be found

location: :-1

Hifi Metaverse Scene export naming inconsistency between json and fbx

Version 2.0

When exporting a metaverse scene, the json adds extra info to [name].fbx. However the actual exported fbx does not contain this extra info, so the json needs to be manually altered to match the fbx models every time. In the example here, the json name "MetaTest" gets added to the existing .fbx name in the json.

Json output= MetaTestCube.fbx
Actual fbx output = Cube.fbx

Recommend leaving the actual fbx output the same, and just remove the extra info from the json.

Example attached.
metabug

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.