-
Notifications
You must be signed in to change notification settings - Fork 314
Morphs creation (Copy/Move/Delete/Rename/Backup morphs tool done) #226
Comments
Quite impressive! I will have to read this over again as I only read through it once but so far what I see I like. Of course making a new morph Python script would be ideal. We can make this a project for the next version perhaps? |
Thanks. ^^ About a new project, why not, but I'd like to be sure that what I'm doing goes somewhere. For now I'll change the existing python files to "prepare" the creation tools, and will post the changes here. |
I'm not sure, but you might want to make a bmesh copy to sculpt, then bake
it back to the original mesh. I do think that you can obtain the
un_modified coordinates the same way you access the "current" coordinates,
but I've never actually used those.
…On Mon, Jan 13, 2020, 3:43 PM TetoTheSquirrelFox ***@***.***> wrote:
[image: image]
<https://user-images.githubusercontent.com/59537161/72289918-6cdc1b00-364c-11ea-80cd-6db8925675e0.png>
Now, first thing to do is to store a copy of the body (all vertices to be
more specific) because after sculpting the morph, I need to compare with a
base, and as the actual body has changed, I need an untouched body to
compare with.
But I can't write body_as_a_base = actual_body, I suppose, and I must
something like body_as_a_base = actual_body.duplicate() and make a real
copy, not an instance. I'll on this tomorrow. And I think that will help me
for comparing 2 body objects.
By the way, about the classes I'm modifying : the changed code is always
between
#Teto
and
#End Teto
So when it will be done, I will be able to send the files to you and it
will be easy (I guess) to change the files in master. Please tell me if I'm
wrong.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#226?email_source=notifications&email_token=AKYHC3XRPNKH7TUN4GVU4MTQ5TG63A5CNFSM4KFX5YB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI2G24Q#issuecomment-573861234>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKYHC3UFGXVKB2TBDEANNQLQ5TG63ANCNFSM4KFX5YBQ>
.
|
No no, it's waaaaay simpler than that. ^^ So no, I don't "touch" anything in the model, I just check the differences between 2 states of a same model that is entirely handled by the engine (which is complex, like, really complex). |
A file called co_to_js.py will put vertices of a selected object into a
.json file.
https://github.com/Noizirom/Blender-Python-Tool
…On Wed, Jan 15, 2020, 2:26 PM TetoTheSquirrelFox ***@***.***> wrote:
No no, it's waaaaay simpler than that. ^^
Actually I want to make a copy of the vertices of the shown model. And a
python program already exists for this (it writes in a file, I just want to
make a special object that stores the vertices).
After that, user does his thing with Blender sculpt tools (without
touching the number/name/id of vertices of course).
And at the end the tool checks just the differences between the base and
the sculpted, then write them in a json file in order to be a regular morph.
So no, I don't "touch" anything in the model, I just check the differences
between 2 states of a same model that is entirely handled by the engine
(which is complex, like, really complex).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#226?email_source=notifications&email_token=AKYHC3UUCKPIWAQQWLWM64TQ55PNDA5CNFSM4KFX5YB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJBQEBA#issuecomment-574816772>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKYHC3RET2UVD2APDZ6UUITQ55PNDANCNFSM4KFX5YBQ>
.
|
I'm not quite sure what your asking , being that you've already found an
addon for this.
…On Wed, Jan 15, 2020, 6:37 PM Zion Hill Hill ***@***.***> wrote:
A file called co_to_js.py will put vertices of a selected object into a
.json file.
https://github.com/Noizirom/Blender-Python-Tool
On Wed, Jan 15, 2020, 2:26 PM TetoTheSquirrelFox ***@***.***>
wrote:
> No no, it's waaaaay simpler than that. ^^
> Actually I want to make a copy of the vertices of the shown model. And a
> python program already exists for this (it writes in a file, I just want to
> make a special object that stores the vertices).
> After that, user does his thing with Blender sculpt tools (without
> touching the number/name/id of vertices of course).
> And at the end the tool checks just the differences between the base and
> the sculpted, then write them in a json file in order to be a regular morph.
>
> So no, I don't "touch" anything in the model, I just check the
> differences between 2 states of a same model that is entirely handled by
> the engine (which is complex, like, really complex).
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#226?email_source=notifications&email_token=AKYHC3UUCKPIWAQQWLWM64TQ55PNDA5CNFSM4KFX5YB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJBQEBA#issuecomment-574816772>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AKYHC3RET2UVD2APDZ6UUITQ55PNDANCNFSM4KFX5YBQ>
> .
>
|
Nope, it's this file. |
I just read the email, I have downloaded the sources and after work tonight I will go through and test this. This is a pretty big deal, I was kind of waiting for this to come into being before I did any other work (aside from my own personal life being very busy atm) I will also go through this issue and read through it so I can start developing some documentation. |
I have added the code to my local copy, right now just checking it out, I still have to fully read through and test it but so far no outstanding bugs. |
It has been committed now |
Line 225 in 73072b2
This is causing the tester on GitHub to fail.
I will look into it when I can |
OK, I did a copy/paste and forgot to erase simple_path. logger.info("Looking for the retarget data in the folder %s...", data_dir) And I remember : the method is not used , you can delete it. ^^ |
OK. I am working on some documentation for this, we should also do some tutorials as well because I think this opens up a lot for people. This also opens up the door to a new model which I would like to start with this one as a prototype... I was successful to a point.... I think if a workflow could be established, this model exported correctly (I think it was a weight paint issue) and then work on some morphs as a proof of concept before we go jumping in to making "production" models. I have yet to fully test because I have not had time yet I plan on doing some this weekend. |
@animate1978 , I read you post on Patreon, I was sure that this tool should please you. ^^ You talked about your fight with phenotypes weeks ago somewhere. So, the tool is ready, and should work. I did few tests, nothing wrong for me. Have fun with it. Anyway, I almost made the 2nd related tool to Character Library, aka Presets. The save is not working for now (because... tired) but should not be difficult to do, as the principle is the same for Expressions and Phenotypes. By the way, the files created have a nice indent now, I read the doc about json, and found the way to indent the data in file. Side note : In fact, morphs are used many times to create all kind of bodies from a single model, before the user can use them again. I'll try to write something about it this week-end. Should be useful for general documentation. |
OK. Good news and bad news (and something funny) :
|
Debug step. Was more difficult than expected, because during the day I was thinking about some little improvements, so... more time on them. Short story : I added the possibility to recover a state of the database. For example, while playing with cursors I am pleased with the result, I can say : please save this step. After that, if I play again but want to recover the previous step, I can. The step is not saved on disk, it's a kind of undo. Why that ? Because the tool doesn't work in real time. And saving on disk for each step would be very tedious very quick imho. So as a workaround, you can quick-save a step on memory, save it on disk (no counter this time, you change the name, it will be fast too), load saved files. The tool is not a tool that you use every day anyway. I'm just annoyed that I can't show changes in real-time, to many things to change in the engine, I think that there are better works to do for now. The addon should be re-written from scratch anyway, in a creator point of view, not as an end user. By the way, setattr has weird initialization sometimes, I wasted time because of that. For example if I do a setattr with a value of 0.45, sometimes the engine puts 0.499999999999122858 in memory. But most of the time was used to link the change between the GUI (by user) and the data in engine. And since that is done, I fix the existing files, that have errors. |
OK I have merged your code, fixed the conflict. @TetoTheSquirrelFox please make sure you pull before making commits, there was duplicate entries made during the conflict merge that I fixed. Nothing you did really it was just how the code merged during the conflict resolution. |
Sorry I don't know how it works, what do you mean by pulling, reimport the project from your repository ? |
@animate1978 I downloaded your repository, I guess it will work fine now. I've just lost almost 2 weeks of work. I was struggling with the transformation tool, how link the content of UI with internal data base of the model, how to update in real time... (watch post above for more details).
The thing that hurts is the transfor.py file. It's almost empty now. ^^ @animate1978 The tool is not finished yet but I push it to see if you have problems to do the commit. |
Oh no, 2 weeks?? OMG I am so sorry, what happened? Was this because you pulled from this repository? Good to see that this is coming together though, very impressive. I haven't merged the code yet but it should be ok to merge I will do that later on tonight or tomorrow. |
No, no, don't worry ! ^^ It's just that my 2 weeks on the job were useless because I found a better way to handle this tool. ^^ So have to rewrite it from scratch ! |
Quick update : My last tool related to morph is almost finished. Tomorrow morning I will be able to push the commit I think. In this tool about transformations (to change age, mass and tone directly) I wrote a small tool that checks the validity/compatibility of the file used by the model shown on screen. Mays be useful if, for a model, people add new morphs for example. So the tool is also useful to see the errors in actual files used by Manuel, and I'm fixing them. But I won't do it for anime character. See below all errors the file has: Obviously the file is either:
|
Little post about few UI things I did. The tool about transformations (age/mass/tone thing) is over, and it's not that good, but I'll talk about that later. While finishing that tool, I also made few little changes in the UI (see below) : And about MB-Dev, I changed the organization and icons to be more coherent with MB-Lab's UI.
|
Well it is better than before, when we had no tools so it is ok. I've been doing trial and error with the GUI and little success so I am sure I am missing something just haven't gotten it yet. I have to look over that patch again and see. |
The complexity is growing... not a bad thing, just something to note for myself. |
I'm tired, and the tool(s) is not finished yet (@animate1978 , I pushed the commit to save files, just in case, but please wait until it's done), but here is a teaser : What's this ? My only issue for now is :
|
Quick update : This evening I did bugfixes (there were a lot!) and improvements in the code, simplification and so on. Now the end is near, the tools should be finished tomorrow (should...). Anyway, @animate1978 , here is something that is relevant to be in documentation I think. Where exactly ? I don't know. In "known issues" maybe ? (below the separation) About the use of drop-down lists:
Where is the problem ?
|
This is great! I did manage to get some warnings from Blender, doing what you described above. I was trying to do it purpose to see what would happen.
Not sure if the duplication is intended. I think I have seen this before when creating the Anime characters. |
Nope, it's not that. I figured that weeks ago, don't worry. |
The Copy/Move/Delete/Rename/Backup morphs tool is done. I tested it, it looks functional and I didn't see bugs (I mean, after I fixed them ^^ ) @animate1978 and @everyone don't hesitate to test it (make backups before !) and tell me if there are bugs or things you don't like or should be improved. I won't explain again how it works, the GUI didn't change much since my last explanations. But there's an addendum : Tool limitations
Warnings
|
So, I try to help by making tools to create like morphs (or muscle if I can figure how it works).
But I had to answer few questions first :
So what I think about that:
You can see the content in characters_config here:
"f_no01": {
"description": "Generate a base female character for creating morphs",
"template_model": "MBLab_human_female",
"name": "f_no01",
"label": "Base female (F_NO01) (AGPL3)",
...
"texture_sclera_mask" : "sclera_mask.png",
"morphs_extra_file": "",
"shared_morphs_file": "",
"shared_morphs_extra_file": "",
"bounding_boxes_file": "human_female_bbox.json",
...
"vertexgroup_base_file": "human_female_vgroups_base.json",
"vertexgroup_muscle_file": "human_female_vgroups_muscles.json"
}
Problem is that some morphs could be very specific to a race or a phenotype, and could not work properly in all models for a reason. So I decided that user could use the model he wants, and create his own morphs while other morphs are already used. To assure that, I put the “morphs editor” in the Pre-Finalized State session (gui_status == "ACTIVE_SESSION") and put it between “random generator” and “measures”. So, for the user who chooses “F_NO01” he can create, and for the others he can use other morphs as well.
So, as MB_Lab is not designed to create bodies from scratch, but more to use what it is available, I tried to be as simple as possible, while let the user to have the most useful tool to create new morphs.
So now here are the problems I’m facing :
"name": "f_ca01",
"morphs_extra_file": "",
"shared_morphs_file": "human_female_morphs.json",
"shared_morphs_extra_file": "human_female_morphs_extra.json",
At first, the tool would have looked like this (on the panel):
But, first I wanted to have my own models, copies of the ones used by the engine, but after a while I started to think that it was not good. The engine is complex, and I should keep a coherence with it. The model the user is working on is linked to the engine, so let’s keep it that way. And the engine has already many useful tools like reset, loading, saving…
So, if the user wants making morphs from base model, no problem, he can use the “reset character” button. If he wants to create while character already has morphs applied, he can use ‘import/export character”.
So now the tool looks like this :
The workflow would look like this :
I’m working on it now, and if you agree, I’d like to make a morph.py dedicated for this, so the changes in other .py files would be minimal. I’d like to talk about the work in progress here too.
The text was updated successfully, but these errors were encountered: