DAZ Importer

add-ons

(Philmister978) #21

I changed the directory so it could be on the F: drive. And while it doesn’t give me the “asset missing” errors it did when I first attempted it, it’s now giving me the error that the edit is about.


(ThomasL) #22

OK, that’s how the DAZ paths are supposed to work. The second error arose because I didn’t check that the loaded file contains an “asset_info” keyword. Evidently every one of the files I have tested have had an asset_info, so I have not run into this case before.

The problem should be gone in the development version. There were a few other places where I didn’t check that keywords exist, checks have been added to those places too. However, since none of my files trigger the error, I cannot guarantee that no further problems arise later on.

Repository: https://bitbucket.org/Diffeomorphic/import-daz
Development version as a zip file: https://bitbucket.org/Diffeomorphic/import-daz/downloads/


(Philmister978) #23

I’ll try it out and get back to you about it.

EDIT: So I tried out the development version, and I’m still getting the error that I mentioned in my previous post’s edit.

Now I really don’t know what’s going on, more so since you mentioned you’ve not gotten that error.


(ThomasL) #24

Sounds like the old version is still active. Have you tried to delete the pycache folder to make sure that the script does not accidentally use the old compiled files?

If that doesn’t do it, confirm that lines 57-58 in file.py read


        if "asset_info" in struct.keys():
            Asset.parse(self, struct["asset_info"])

If they don’t, you don’t have the most recent version. And if they do, it is impossible that you get a key-error for “asset_info”. In that case Blender must be looking for the script in some other location. Blender 2.78 and 2.79 uses different addons folders, perhaps there is a mixup there.


(Philmister978) #25

I deleted the folder, so I’ll see if that works. If not, I’ll take your advice with the .py file itself, but just to forewarn you- I’m horrible with scripting.

EDIT: So I deleted the file, nothing happened. And as I said, I can’t figure out how to open the .py file in Blender’s Python screen, so yeah.

And I’m using both, the developmental version as linked in post #22 and Blender 2.79 for future frame of reference.


(ThomasL) #26

You can open a python file in Blender or in a ordinary text editor. In Blender,

  • Select the Scripting screen and press Open.
  • Navigate to the addons folder, select file.py and press Open Text Block.
  • The file opens in scripting window.


In the error trace that you submitted before, the full path to the file on your computer is listed. Basically the same as on my computer, except my file is in the 2.78 folder and yours in 2.79.

In your trace the error occurred on line 54. Is that still the case? The highlighted lines are now on lines 57-58, so if you still get an error on line 54 Blender is definitely looking at an old version of the script.


(Vectorius) #27

Hello Thomas, kudos on this fantastic work!

I am having an issue: After importing corrective morphs and adding shape key drivers, the corrective morphs do not look right. I have tried this on the imported armature, the MHX and Rigify.

I suspect (though I could be wrong) that the pJCMs are shaped in the direction the joints move inside Daz Studio, which for some reason do not move the same way in Blender.

The easiest example to try is the knee. In DS the shin rotates 90°with the foot going inward, in Blender it rotates straight back whether in global or local rotation.

I would like to hear your thoughts on this.


(Philmister978) #28

Tried fixing it in the script editor, and it still shows up with that error (the highlighted part you mentioned is still on lines 57-58 like in your picture).

So i don’t know, maybe the development version is still using the old file? Because I am using the development version. And I don’t know how to completely remove the the old version if the development version is in fact updated.


(ThomasL) #29

Philmister978: Let me see if I get this right. You still get the same error message as in #19, and the last line in the traceback still points to line 54 in file.py. And when you open the file (with exactly the path specified in the error) the same code is at line 58?

This is completely incomprehensible to me. Perhaps you could try to disable the addon, remove all files, and make a fresh install from the zip file. Apart from that, I’m at a complete loss.


(ThomasL) #30

Hi Kross,

I have never used the corrective shapes, so I don’t know. For my purposes - and I am a better coder than artist - the default deformation has been good enough.

The importer does redefine the roll angle in order to make local X the main bend axis, partly because MHX and Rigify expects this. This does not prevent loading poses, because rotations in DS are defined in armature space. If corrective morphs are specified in local bone space, there will be a problem though. One could imagine an option not to change roll angles. I’m not sure how well that would work, since Blender will force local Y to point along the bone no matter what.


(Philmister978) #31

I did exactly what you said and it still gives me that error.

I don’t know, maybe it’s my computer itself, or the version of Blender I’m using, but it isn’t working regardless of what I do.


(Philmister978) #32

Okay then, I just tested the plug-in again, and it works… for Gen3 models.

But when I try to import one of my models using the Gen1 body however…


It’s a similar error to what I’ve been getting trying to import the same character, albeit in a different outfit.

btw, this is the character I’m attempting to import:



(ThomasL) #33

Seems like some old Daz files don’t follow the same conventions as more modern ones. I tried some old files and had some problems loading them into Blender. That is now fixed in the development version, and hopefully that helps with your character too. If the importer reports an error, try decreasing the verbosity setting in the Setup panel. My problem character imports with verbosity = 1 or 2, but with verbosity >= 3 there is an error message.


(Philmister978) #34

I’ll try that out and see how it works.


(Philmister978) #35

Okay, so I tried it with a verbosity of 1, and it managed to import with no error reports (though the model itself crashed Blender).

I also don’t get why the materials look so red when the model is imported. Is there a reason why?


(ThomasL) #36

If you refer to the viewport colors, the importer assigns a skin color to skin materials and a reddish brown to clothes by default. You can change those colors in the import settings. However, I think that you talk about the rendered image. In that case you need to inspect the miscolored material to see why it behaves like it does.

If you use Blender Internal and some image is missing it might be replaced by a purple color, which might turn the render red. If that is the reason, you can try to reimport the character with a higher verbosity setting. With verbosity = 2 you should not get any errors, but some info is printed in the console. With verbosity >= 3 some problems generate errors, but the importer may tell you which asset it did not find, and you can check if it is there.


(Philmister978) #37

No, I was talking about the default importing colors and wondering why reddish brown was the default.

Though the textures in the “preview” of the materials tab also look like they’re washed out when I go to look at them.


(Philmister978) #38

So anyways, I managed to finally import my character, but I can’t seem to get Gen1 morphs to work for some reason.


(ThomasL) #39

If you set Color Choice to White in the import settings you get the original diffuse color specified by DS, which is almost always white and hence looks rather boring. With Color Choice = Guess, the importer changes diffuse colors, but only when there is a diffuse texture, so the render output is never affected. To make the character look as in DS, change the viewport settings to texture shading. There is a performance penalty for this, however.

No morphs are imported. Instead the importer gets information about the vertex coordinates from a json file that is exported from Daz Studio with the custom script included with the importer. I had lots of problems to get the mesh and bone coordinate right, in particular for fitted clothes, but with this method all characters seem to import correctly. For details, see http://diffeomorphic.blogspot.se/2017/07/json-fitting.html.

Morphs like facial expressions and visemes can be loaded separately after the character is imported, in the Morphs section of the Setup panel.


(Philmister978) #40

Yeah, that’s the problem though, when I try to import the facial morphs for my character into Blender, it tells me this:


it shows the expressions and visemes no problem, and it imports them, but for whatever reason they’re got the purple over the slider. How do I fix this error?