-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
empty (gray) png results #4
Comments
I know what this could be. I faced a similar problem here: https://bitbucket.org/Diffeomorphic/import_daz/issues/357/it-is-possible-to-read-dhdm-files-directly (you can check the equivalent function there although that program has diverged quite a bit). I forgot to open an issue here, but there is a small bug in the logic of the applyMorphs() function. Check the flow of it and you will notice that .dhdms extracted from .dsf files don't have their level considered, so the HD level is never detected: Line 28 in f56c3c9
The fix should be easy, just doing something like what is done in the other if branch (or better yet, doing it after the branches): Line 31 in f56c3c9
If the .dsf file you are trying to use (FBMAngharad8.dsf) doesn't have any HD information, then you are trying to bake base deformations in the textures, and the program isn't written with that in mind. In that case you will need to make more changes (again, you could check the version from the bitbucket link above). Also, why are you using the same .dsf twice? that's the same as passing a strength of 2 (see edolstra's readme) which is weird and will give you a lot of scaling problems (scale is another thing you need to consider when dealing with large deformations like base morphs). Also, just in case edolstra reads this, another issue I faced was that when using the program as a .dll, calling fclose() around here was necessary: Line 226 in f56c3c9
I think I'm not forgetting anything. |
thanks for your quick reply Xin, actually i came here from your post on the diffeomorphic post however, i've pretty much copied your code and that wasn't the root of my problem thats my code now: unsigned int applyMorphs(Mesh & mesh, size_t nrPaths, char * paths[])
{
std::vector<std::pair<double, Dhdm>> dhdms;
unsigned int level = 1;
for (size_t i = 0; i < nrPaths; ++i) {
std::string fn = paths[i];
double weight = 1.0;
auto c = fn.find('=');
if (c != fn.npos) {
weight = stod(fn.substr(c + 1));
fn = std::string(fn, 0, c);
}
std::string dhdm_path = "";
if (fn.size() >= 4 && std::string(fn, fn.size() - 4) == ".dsf") {
if (auto dhdm_path_2 = mesh.applyMorph(weight, fn))
dhdm_path = *dhdm_path_2;
}
else {
dhdm_path = fn;
}
if(dhdm_path.size() > 0){
auto dhdm = Dhdm(dhdm_path);
level = std::max(level, (unsigned int) dhdm.levels.size());
dhdms.push_back({weight, std::move(dhdm)});
}
}
mesh.subdivide(level, dhdms);
return level;
}
it's the Angharad8 with HD Addon, so there should be HD morphs in there?!
one is FHM (head) the other FBM (body) maybe i'll wait a few days for your fork to finish and then i'll give it a try to make it a command line tool again ;) also another question about your fork: where is the normal baking done? In the dhdm parser or in blender? |
Unless I'm misunderstanding what you are trying to do, the "Angharad 8" file you are using I believe is the base mesh morph, that's why you are getting those large scaling issues:
You want to use the morph files for the HD details (.dhdm files). If you really want to bake base deformations in the textures, you need to change the scaling to accommodate such large deformations (or you could try including EXR support from from the bitbucket version, which doesn't have scaling limits). Look into changing the first parameter here: Line 73 in f56c3c9
And then make sure that the console output stays between 0.0 and 255.0 instead of these very large values:
Ok, just read your edit. Then yes, your problem seems to be that you are passing the wrong .dsf file. You want to pass .dhdm files. You can find those in the same directory I believe. It's likely there will be a .dhdm for the head and one for the body. |
thank you, you are correct those files didn't refer to the HD Morphs, i'm now getting visible results with
edit: my actual goal is to get displacement/normal maps from the morphs for use outside of blender, maybe my whole approach with this tool is wrong and i should go with your blender solution (which sadly is only available for windows at the moment of writing) |
I don't know what that dsf file contains, but as a tip, you can check the .dhdm file associated with a .dsf file by opening the .dsf file with a text editor (you might need to gzip decompress the file first) and searching for the following keyword: "hd_url". It will point to the .dhdm file. You should be using that one to avoid scaling issues. The normals baking depends on Blender. But since you are already compiling the program, you shouldn't need to do much to compile it for linux. Just look into creating a shared library instead of a dll and changing a few things if necessary on the python handling of the dll. |
Hi, for some reason my results are all 0 weighted (rgb values of 127.5)
any idea what this could be related to?
my script:
output:
on a sidenote, my compiler was complaining about the two abs() calls returning int values in diff.cc which was solved by replacing abs() with std::abs()
dhdm/src/diff.cc
Line 100 in f56c3c9
dhdm/src/diff.cc
Line 141 in f56c3c9
The text was updated successfully, but these errors were encountered: