Transfer Collection Hierarchy From Blender To 3Ds Max (And Back)

by Andrej scripts in Addons



If you have any problem with installing this addon, please contact me on either Discord or BlenderMarket - I'm one message away. 

A question: would that kind of feature will be also useful for someone in Maya or some other software? Please let me know.


26 Aug 2023: BMAX Connector integration allowing to copy models and hierarchy 3ds Max <-> Blender in 2 clicks. Demo. Instructions for installationa are below.




What script does.

The problem you might met is when you export model from Blender to 3ds Max using fbx you lose all the collections hierarchy when you probably expect to preserve this hierarchy as layers.

This addon does exactly that:

It also has option to export 3ds max model hierarchy and import it as collections hierarchy in Blender.

You can also use this addon to save current Blender / 3ds max hierarchy, play around with it and take it back. This is useful if you use FBX that loses hierarchy information and you want to preserve between Blender / 3ds max projects.

Extra Blender Tools.

I've also added the version that contains some Extra Blender Tools which includes some other Blender tools you might find useful:

1) Prepare for multimaterial - adds all selected materials to all selected objects. Sorts them in alphabetical order. Why you might need it - it will allow to transfer all your materials to 3ds Max as ONE multimaterial with different indexes for the different objects. If you won't use it then 3ds Max will create separate materials.

2) Remove unused materials - removes all unused materials from the selected objects. Basically it undoes "Prepare for multimaterial".

3) Update face strength vertex colors - colors all vertices by related face strength. Why it could be useful - as you might know Blender has this feature "Face strength" which allows you to specify which face is more important in terms of adjusting normals and then Blender will take that face strength thing into account when you apply "Weighted Normal Modifier". "Update face strength vertex colors" allows you to work with it visually - you can select as much objects as you want and then run the thing and it will color code object faces based on their face strength (weak = red, medium = blue, strong = green). Face colors saved as vertex colors you can find in object data properties -> attributes. Example you can see at the screenshot below.

4) Clear face strength vertex colors - undoes "Update face strength vertex colors" by clearing vertex colors related to face strength.

5) Toggle draw final vertices normals - draw vertices normals after all modifiers applied for the selected object. Meaning it will allow you to see weighted vertex normals before applying them - it could be useful so you can adjust the face strength and see result immediately. This feature is kind of experimental and works only for ONE selected object.

Update face strength demonstration:

Draw final vertices normals:







Working process for Hierarchy Transfer.

Here's the video that sums it up.


Text instruction:

1) You use "Export objects hierarchy to json" button which comes after addons installation and it saves current scene hierarchy to the same folder where .blend file located.

For example, if your .blend file is "box.blend" then "box.json_hierarchy" will be created



2) Then you go to 3ds Max, open your model and use "Import hierarchy from json" button. Voila! You just imported your scene hierarchy.


For exporting hierarchy from 3ds max to Blender the process is exactly the same:
- use "Export hierarchy to json" button in 3ds max
- use "Import hierarchy from json" in Blender.

Notes:


1) It's okay if your 3ds max / blender scene miss some objects from original blender / 3ds max scene - it won't interrupt script's working process.
2) You might met error 'You need to save file before exporting hierarchy', it means your file isn't saved and script doesn't know where to save .json_hierarchy file. You need to save file and try again.

Installation process.

Script requires Blender 3.0+ and works with 3ds Max any version.
Note: Blender < 3.0 could work also but no guarantees, 3ds Max should have Python API support (>= 2017).

I've tested the script so far with 3ds Max 2019-2022 and it works fine. There is no significant differences in Python API before 2019 so it will work on those version fine too. Please contact me if you met any problem with versions before 2019. Also let me know if someone needs this plugin for Blender version below v3.0.


1) BLENDER. Install blender_transfer_hierarchy_with_json.py as blender addon (User preferences -> Add-ons -> Install… -> select py file; activate addon by toggling check)



Then you'll see new "Hierarchy" panel at the right side of your viewport


2) 3DS MAX. FAST way to install 3ds max scripts - open 3ds max and drag'n'drop max_transfer_hierarchy.mzp archive to the 3ds max window. 

After that you'll see "transfer hierarchy to json successfully installed" window 

and you can notice that there are two icons were added to your tooltip - one for hierarchy import and one for hierarchy export.



If the method above didn't worked for some reason (please let me know by the way). You can use the manual way:

2) Copy import_hierarchy_from_json.mcr and export_hierarchy_to_json.mcr to %appdatalocal%\Autodesk\3dsMax\2021 - 64bit\ENU\usermacros\

3) Copy max_import_hierarchy_from_json.py and max_export_hierarchy_to_json.py to %3dsmaxfolder%\scripts\Python\

4) Add 3ds max button: Customize -> Customize User Interface -> Toolbars -> Category "MAX Script" -> Drag "Import hierarchy from json" and "Export hierarchy to json" wherever you find the most convenient.


BMAX Integration
To install the BMAX integration you need to reinstall BMAX Connector using the bmax_connector_3ds_max_addon.zip included in the acrhive (just drag'n'drop it in 3ds MAX).
If you have blender_max_tools version < (0, 5, 0) OR blender_transfer_hierarchy_with_json < (0, 2, 0) or then you'll also need to reinstall it.

Post scriptum

Looking for your feedback, what you like and what you don't. Please share your suggestions or ideas what would you like to see.

If you have some idea that's bugging you - like something in your work flow in Blender (or 3ds Max or any other program as a matter of fact) just takes too much time or just isn't possible currently and you looking for a way to automate it / make it work, you can contact me. I'm really looking for ideas like that to make community life better.


Change Log

27.06.2024 - Fixed issues exporting instance collection empties (thanks to @Nobuhisa for the bug report), exporting/importing objects linked to the scene collection.

20.04.2024 - Fixed issue on 3ds plugin breaking on versions <= 2020 (fixed python 2 support). Thanks @trungha5500 for the bug report.

15.07.2023 - BMAX Connector integration allowing to copy models and hierarchy 3ds Max <-> Blender in 2 clicks. Demo.

12.04.2023 - fixed blender scripts errors on disabling the addon; added fix for blender < 3.0 `poll_message_set` so users won't get spammed with errors

01.04.2023 - updated Blender scripts - fixes for Blender 3.5 (previously it was using `bgl` library that's now deprecated - it was producing warning on most of the systems and wouldn't work on Metal)

12.03.2023 - updated Blender scripts - fixed bug when it was possible to get incorrect hierarchy if you have linked library in blend file and library object share names with objects from the main file. Now it's safe in that case too.

22.01.2023 - added fast 3ds max installation method

16.12.2022 - Tested plugin on Blender 3.4, added option to export hierarchy only for SELECTED objects

06.10.2022 - Tested plugin on Blender 3.3

13.06.2022 - Added extra blender tools

03.03.2022 - Fixed bug with importing settings that occured when layer from .json_hierarchy already existed before import (thanks to @Maamesi)

24.02.2022 - Added support for 3ds Max < 2020

15.02.2022 - Addon release



  • Plugins to save your Blender and 3ds Max objects hierarchy (+extra blender tools)

    $12
  • Plugins to save your Blender and 3ds Max objects hierarchy

    $7
$12

Have questions before purchasing?
Login to message

Details
Sales 70+
Rating
4 ratings
Published over 2 years ago
Software Version 4.2, 4.1, 4.0, 3.6, 3.5, 3.4, 3.3, 3.2, 3.1, 3.0
License GPL