animate1978 / MB-Lab

MB-Lab is a character creation tool for Blender 4.0 and above, based off ManuelBastioniLAB
Other
1.76k stars 308 forks source link

Creation Ops model file loading error #279

Closed animate1978 closed 3 years ago

animate1978 commented 4 years ago

Describe the bug When attempting to load a model file into MB-Dev

To Reproduce Steps to reproduce the behavior: Create the project Create the config files Load the model file

Expected behavior To load the model file

Logs `Error: Traceback (most recent call last): File "/home/farishta/.config/blender/2.82/scripts/addons/MB-Lab/init.py", line 5620, in execute creation_tools_ops.load_blend_file() File "/home/farishta/.config/blender/2.82/scripts/addons/MB-Lab/creation_tools_ops.py", line 309, in load_blend_file with bpy.data.libraries.load(lib_filepath) as (data_from, data_to): UnboundLocalError: local variable 'lib_filepath' referenced before assignment

location: :-1 ` Replace the text here with your logs. To turn on the console in Blender 2.80 go to Window>Toggle System Console.

TetoTheSquirrelFox commented 4 years ago

Have you put your model under /data/ ? With its name as "your_project_name"_library.blend ?

For the bug it's not a bug, I just forgot to add a "return" if the file is not found. Change the file and push it in the repository.

animate1978 commented 4 years ago

The file is in /data

The file is named toon_female_library.blend

EDIT:

Just tried with the humanoid_library.blend file as well, have the same results

TetoTheSquirrelFox commented 4 years ago

Can you send me your config file please ?

animate1978 commented 4 years ago

toon_girl_config.zip

EDIT : This contains the blend file as well.

TetoTheSquirrelFox commented 4 years ago

OK. First, your config name should have the same name as the blend file aka : xyz_library.blend xyz_config.json I take your blend and try to recreate your bug from your description, but for me something got wrong when you created the config file. Stay tuned. Edit : And there's a problem with your config file, because it's pretty empty. It should not.

TetoTheSquirrelFox commented 4 years ago

OK. So, how it goes : I decided while coding all of this, to unify names in projects, to avoid fancy ones, and projects with different names for the same thing. And to be as simple as possible, I decided that the project name must be alphanumerical only, without characters like "_-è=" and so on.

So when I start with your names I already have a problem : image I named the project as your blend, and _female is cut. So I named your blend toon_library.blend, so you could add after a male model as well. image

(I update this comment each time I finished something, to let you do the same thing on your side)

So now I click on "create project directories" Then "create configuration" And you should have this : toon_config.zip The same file that you sent to me.

Now I clicked on "load config" and model loaded. image

animate1978 commented 4 years ago

Hmm... so I managed to get past the "Load models file" !

So not so much a bug after all

TetoTheSquirrelFox commented 4 years ago

No and I see where your problem was : your name of the project is different of the name of your blend, and the name of your blend has a '_' (aside '_library').

So rename your config file 'toon_config' and your blend file 'toon_library' and that should be OK. I exited Blender, re-opened it, tried to load your project, and the model loaded.

Edit : don't forget to recreate the sub-directories.