Sat, Nov 9, 4:40 PM CST

Renderosity Forums / Blender



Welcome to the Blender Forum

Forum Moderators: Lobo3433 Forum Coordinators: LuxXeon

Blender F.A.Q (Last Updated: 2024 Nov 03 9:26 pm)

Welcome to the Blender Forum!


   Your place to learn about Blender, ask questions,
   exchange ideas, and interact with the other Blender users!


   Gallery | Freestuff | Tutorials

 

Visit the Renderosity MarketPlace. Your source for digital art content!

 





Subject: Making a face morph for genesis


millighost ( ) posted Mon, 29 August 2011 at 5:51 PM · edited Sat, 09 November 2024 at 4:36 PM

file_472376.txt

Here is how you can create a simple face morph for DAZ's Genesis figure using only blender, in 12 easy steps.

Install the import plugin

First you need to load the Genesis mesh into blender. You could use either wavefront obj files, or you could use the included plugin (see link). I describe the latter way, since it is easier. Download the plugin and rename it to import_dsf_geom.py.


millighost ( ) posted Mon, 29 August 2011 at 5:51 PM

file_472377.jpg

Installing the plugin

Open your user preferences from blender's file menu. You can usually install the plugin by clicking the "Install Add-On" button on the bottom of the page.


millighost ( ) posted Mon, 29 August 2011 at 5:52 PM

file_472378.jpg

Install the plugin

Point the file browser to the downloaded plugin, and then click the "Install Add-On" button

However in the current version blender has problems with installing plugins from network drives (which is the case for me). In this case you can install the plugin manually by copying it into blender's addon folder. On my computer the addon folder is V:/blender/2.59/scripts/addons. Simply copy the import_dsf_geom.py into that folder.


millighost ( ) posted Mon, 29 August 2011 at 5:53 PM

file_472379.jpg

Load the Genesis figure

From the file menu's import submenu select "dsf-geom (.dsf)" (if you prefer the space menu, the operator is called 'import dsf-geom').


millighost ( ) posted Mon, 29 August 2011 at 5:56 PM

file_472380.jpg

Activate the plugin

I almost forgot, sorry: After the plugin is installed you need to enable it: In the user preference window, select the Import-Export plugins. The import plugin will appear in the list as "Import-Export: import dsf-geom". Enable the check-box for it. You can select "Save as Default" now, so blender will enable the plugin on the next restart.


millighost ( ) posted Mon, 29 August 2011 at 5:59 PM

file_472381.jpg

Loading the Genesis figure

After you select the import from the menu, you will be presented a file dialog in which you can choose the Genesis.dsf file. The Genesis.dsf file is located within your DAZ-Studio installation's data folder. On my system this is V:/dsdata4/data/DAZ 3D/Genesis/Base/Genesis.dsf. Note that there might be another Genesis.dsf within the People directory, this is not what you need.
The other options of the plugin (materials, groups, uv-map) are not effective, because this is a reduced version (i wanted everything one one not-too-big file).


millighost ( ) posted Mon, 29 August 2011 at 6:00 PM

file_472382.jpg

Prepare the morph

After you have successfully loaded the Genesis loaded you can scale it down a bit, since it is very huge (around 100 blender units). Scale it down in object mode, not in edit mode, so the actual mesh will not be distorted. You can also rotate it in object mode if you want, because it is lying flat (DAZ-Studio uses Y-axis as up).
In the mesh tab create a new shape key for the Genesis mesh. Press the Plus-sign twice to create one base shape key and another shape key for the morph. The first shape key is the Base shape-key and not to be modified. The second one created is the one that holds the morph, which is currently empty.


millighost ( ) posted Mon, 29 August 2011 at 6:01 PM

file_472383.jpg

Prepare the morph

In order to use the shape key later for creating a morph, assign a name to it right now. Currently it is named "Key 1", the default name given by blender.The shape key's name is later used by the exporter to assign a group and a name to the created morph. To tell the exporter the name and the group, assign a name to the shape key where the components are separated by slashes ('/') starting with a slash. I set the shape key's name to /Millighost/LongNose, so it will appear in DAZ-Studio in the modifiers list under "Millighost" and have a name "LongNose".


millighost ( ) posted Mon, 29 August 2011 at 6:03 PM

file_472384.jpg

Create the morph

Make it the created shape key the active shape key (it must have a blue background) and enter edit mode. Here you can move vertices in whatever way you like for your morph. In the illustration i made the nose longer by selecting a view vertices at the tip of the nose, and drag them out with the proportional editing tool. Do not delete or add vertices in any way, or the morph will not work.

After you are done, go back to object mode. The newly created shape will disappear, you can check what it looks like by playing with the Value parameter of the shape key.


millighost ( ) posted Mon, 29 August 2011 at 6:04 PM

file_472385.txt

Install the exporter

To write the created shape key as a morph, you need another plugin that writes the shape key as a dsf file. Download the attached file and rename it to export_dsf_morph.py. Install it into blenders plugins in the same way you did in step 1 for the import plugin.


millighost ( ) posted Mon, 29 August 2011 at 6:05 PM

file_472386.jpg

Activate the exporter

Like the importer before, this exporter has to be activated, too. In the list of Add-Ons of the user preferences select the Import-Export section.The plugin is named 'Import-Export: export dsf-morph'. Enable the checkbox for it.


millighost ( ) posted Mon, 29 August 2011 at 6:06 PM

file_472387.jpg

Now call the exporter by choosing it from blender's Export menu, where it is called "dsf-morph (.dsf)" (in the space menu, it is "export dsf-morph"). You get a file dialog where you can choose a file name under which to export the shape-key/morph (i use a name "longnose.dsf"). The file should end with ".dsf", otherwise the name is not particularly important.


millighost ( ) posted Mon, 29 August 2011 at 6:12 PM

file_472388.jpg

If all worked so far, you can stop blender now. The exported file "longnose.dsf" needs to be copied to your DAZ-Studio contents directory. Usually the morphs are within the ".../data/DAZ 3D/Genesis/Base/Morphs" directory within DAZ-Studio's installation data directory. DAZ-Studio seems to look in there for files by default. You can create a subdirectory within the Morphs directory for your own morphs. I copied it to V:/dsdata4/data/DAZ 3D/Genesis/Base/Morphs/Millighost/longnose.dsf. After that you can start DAZ-Studio. With Genesis loaded, in the parameters tab, select the Actor group. Based on the name you have given the shape key, the morph should be listed in there. Dialing the slider should dial in the morph/shape-key.

That was it. Hope this works, i only tested this once with windows, since i use linux most of the time, so let me know if there is something not working :-)

Good night & good luck.


DoomsdayRenderer ( ) posted Mon, 29 August 2011 at 11:10 PM

Wow, millighost! Impressive. I must try it when I have time. Looks very promising!


_Venkman_ ( ) posted Sat, 17 September 2011 at 12:13 AM

Neat script. DS4 can save as a variety of different kinds of DSF files, and so I was wondering if your script could handle a user created Character or Figure DSF? Or is the Genesis.DSF you use in your tutorial the only one it can handle?

What I would like to do is dial up an approximation of a Genesis character in Daz Studio, save it as a Character or Figure DSF, and then bring it over to Blender via your script for scupting, etc.


millighost ( ) posted Sat, 17 September 2011 at 10:12 AM

Quote - Neat script. DS4 can save as a variety of different kinds of DSF files, and so I was wondering if your script could handle a user created Character or Figure DSF? Or is the Genesis.DSF you use in your tutorial the only one it can handle?

The import script given above handles all dsf files that contain figures, or so it should at least. However at the time i wrote it, there were no other figure files than genesis available, so i only tested it with the genesis.dsf, so i am not really sure if it would really work with different figures. Probably your best bet is to just try it out on a different figure. If it does not work, and the project is not top secret you could send the file to me and i can try to guess what is going on...

Quote - What I would like to do is dial up an approximation of a Genesis character in Daz Studio, save it as a Character or Figure DSF, and then bring it over to Blender via your script for scupting, etc.

I am not exactly sure what you are doing in DS; can you describe it more detailed, like exactly which menu items you use to export the character dsf? (I am relatively new to DS, i still did not find out which buttons to press to export the dsf files that i want it to).

However the script above does not import morph files, if that is what you need. If you do - i guess i can post one i have made (but still needs some smoothing). 


_Venkman_ ( ) posted Sat, 17 September 2011 at 12:41 PM

No top secret project, I was thinking it might be nice to have something other than the default male shape when you bring Genesis into Blender, like the Basic Female shape. However, I've since realized that if I was going to redistribute my morphs later, this wouldn't work out unless I could zero out the influence of the non-default morphs I didn't make myself. Still, for going back and modifying one's own work, being able to import a morph file could be handy.

I use DS4 Standard (4.0.2.55), and I have options for saving Character File, Shaping File, and Pose File DSFs. Pro or the CCT has more options, like Figure File, and I'm going to guess that Figure File should have everything like the base Genesis DSF. I'm still new to DSFs, so I can't really say what the difference between some of these are.

Here is how to export your own DSF: Load Genesis and apply any morphs you would like. Then, with just Genesis selected, go to File>Save As> and you should then see some DSF options. Unfotunately, I don't think the 'Smart' Content tab can find these, or I haven't figured out where it puts them because they weren't in Unassigned last I checked, while a DSF pose I made was.


SilverDolphin ( ) posted Sat, 17 September 2011 at 8:58 PM · edited Sat, 17 September 2011 at 9:05 PM

This is great millighost!

Thank you for the Blender Daz import scripts!

This is very generous of you!:biggrin:


ElenaHD ( ) posted Wed, 05 October 2011 at 1:39 AM

Fantastic! Thanks millighost!

I was able to make my first own morphs for DS4 :)

 

But, after tweaking my DS4 installation and upgrading to Advanced plus CCT now I have the problem to import dsf Files.  Maybe it has to do something with absolute paths. I wonder how your importscript can find Genesis.dsf, since my dsf Files only seem to have relative paths, beginning with /data?

For example: 

"url" : "/data/DAZ%203D/Genesis/Base/Genesis.dsf#geometry"


SickleYield ( ) posted Wed, 14 December 2011 at 7:49 PM

It works!

Quick proof-of-concept earless morph I just did:

 

Thank you thank you thank you!! 


XaatXuun ( ) posted Thu, 22 December 2011 at 6:28 PM

I don't know why, but let's just say I've never done it, but how do I rename the script from txt ?

I have retyped the name, many times now, but it still saves in Txt, what am I doing wrong ? or forgetting something


SickleYield ( ) posted Thu, 22 December 2011 at 6:31 PM

Do you have your operating system set to show file extensions? If not it may be renaming to .py.txt instead of just .py.


XaatXuun ( ) posted Thu, 22 December 2011 at 8:19 PM · edited Thu, 22 December 2011 at 8:26 PM

Quote - Do you have your operating system set to show file extensions? If not it may be renaming to .py.txt instead of just .py.

hmm thought it may be that, I just took a look and the extention is not shown , so now I need to recall how to add it , I'll search for a refresher for me to remember

 

ETA: yup, just needed a refresher, of how to do it,   got it  now.

now to play with blender, thank you


bruce32466 ( ) posted Tue, 07 February 2012 at 4:59 PM

Is it posible to add multiple morphs in this maner? Would it be a matter of adding more shape keys? What I'd like to do is creat a morph to pull the nose out as you did and then use a second morph to widen the nose. If it's just a matter of creating another shape key, I could use a little help. I can create additional keys but when I go to eddit mode, the figure goes back to it's original state so the keys are not progressions of the previous key. Yep, a noob. Anyway, thanks


SickleYield ( ) posted Tue, 07 February 2012 at 5:12 PM

It's absolutely possible to do multiples. I've done a whole product pack of elf ears with this method.

Do you mean when you go to object mode?  You have to have created your width morph in edit mode for it to exist at all.

Either way, when in object mode, notice the "value" bar below the Shape Keys dialogue.  You can type a value in this or click and drag to increase value of a shape key in object mode.

I don't think you can create a shape key additive to another one (that is, with a previous one applied and visible in edit mode), but I'm willing to be corrected on that point.


bruce32466 ( ) posted Tue, 07 February 2012 at 9:35 PM

Hi SickleYield, Thanks for the response. I think I asked the question incorectly. I fallowed the directions above and all went well. My question is: how should I go about including another morph to furthe modify the first morph. When I create a third shape key, the figure in the third key starts out like the base figure (no modifications). I did try with the value set to 1 as well as 0 and made no differance. the figure would always revert back to base shape.  With the value set to 1 on shape key 2 in object mode, I could see the changes made to the mesh. but as soon as I try to go to edit mode for shape key 3 the figure reverts back to its base shape.


SickleYield ( ) posted Tue, 07 February 2012 at 9:55 PM

In that case I would have to work around it by duplicating the figure (shift d), moving it to another layer in Blender (M key plus click layer) and directly modifying the second key.


bruce32466 ( ) posted Tue, 07 February 2012 at 11:21 PM

Hi SickleYield, Thanks again. I would have got back to sooner but I had to do a little digging aroud to figure out what you were telling me here.

So, If I understand correctly, I will create bsasis and 2nd key, modify 2nd key, press shift + d to copy it, select the copy i just made and push the m key , move copy of 2nd key to a new layer, modify it further, create 3rd shape key and move the modified copy back to original layer and export.

Didn't work:( can't get to edit mode on new layer, m key doesn't seem to do anything in edit mode. I'm sure it's probably something simple I may be missing I hope. I've started playing around with this 3D about a couple months ago and is very cool stuf


SickleYield ( ) posted Wed, 08 February 2012 at 12:48 AM

The m key is just for moving to a new layer in object mode.  Once you're on the new layer, you will need to select your copy that you moved by right-clicking on it in order to switch to edit mode.


millighost ( ) posted Wed, 08 February 2012 at 1:43 PM

file_478344.png

> Quote - ... I don't think you can create a shape key additive to another one (that is, with a previous one applied and visible in edit mode), but I'm willing to be corrected on that point.

You can enable shapekeys in edit mode by clicking on the small cube-lookalike button (see illustration). That enables the shapekeys in edit mode according to their current value. That includes the shapekey you are currently modifying, though. So to use it, you have to dial the shapekey to 1 before going into edit mode, otherwise you will not see what you are doing.


SickleYield ( ) posted Wed, 08 February 2012 at 1:46 PM

Excellent, thank you. :)


bruce32466 ( ) posted Fri, 10 February 2012 at 8:16 PM

OK, Finally got some time to play again and thanks for the help earlier. I was able to create the needed shape keys for additional morphs but exporting seems to be tricky(at least for me). If I export as .dsf to the morph directory, I have to select each shape key and export them separately in order to see the three of them.

In Daz Studio4 pro, I created a caracter and applied the first morph and saved the seen. Then after going back to Blender and creating the other two additional morphs and exporting those, I was able to see the all three morphs in a new seen. when I opened the saved seen, only the first morph was avalible in the menu.

Two questions:

1) When making more than one shape key, what is the proper methode to export them to daz? Please keep in mind I do need a little detail as iq is somewhat low:)

  1. Is there a way to refresh the menu in parameters instead of restarting Daz Studio.

btw, the tutorial here was very helpfull, so thanks.


amy_aimei ( ) posted Sat, 11 February 2012 at 6:55 AM

Quote - Prepare the morph

After you have successfully loaded the Genesis loaded you can scale it down a bit, since it is very huge (around 100 blender units). Scale it down in object mode, not in edit mode, so the actual mesh will not be distorted. You can also rotate it in object mode if you want, because it is lying flat (DAZ-Studio uses Y-axis as up).
In the mesh tab create a new shape key for the Genesis mesh. Press the Plus-sign twice to create one base shape key and another shape key for the morph. The first shape key is the Base shape-key and not to be modified. The second one created is the one that holds the morph, which is currently empty.

Thank you for the plugin.  As I know, DAZ Studio uses Metre or Centimetre as the unit of measure and as you pointed out it uses Y-axis as up.  Is it possible to perform the scaling and rotation within the code?


bruce32466 ( ) posted Sun, 12 February 2012 at 9:29 PM

Bump!

Quote - OK, Finally got some time to play again and thanks for the help earlier. I was able to create the needed shape keys for additional morphs but exporting seems to be tricky(at least for me). If I export as .dsf to the morph directory, I have to select each shape key and export them separately in order to see the three of them.

In Daz Studio4 pro, I created a caracter and applied the first morph and saved the seen. Then after going back to Blender and creating the other two additional morphs and exporting those, I was able to see the all three morphs in a new seen. when I opened the saved seen, only the first morph was avalible in the menu.

Two questions:

1) When making more than one shape key, what is the proper methode to export them to daz? Please keep in mind I do need a little detail as iq is somewhat low:)

  1. Is there a way to refresh the menu in parameters instead of restarting Daz Studio.

btw, the tutorial here was very helpfull, so thanks.


SickleYield ( ) posted Sun, 12 February 2012 at 9:45 PM

11.) Set one key to 1 in object mode and follow the tutorial in Post 1 from there.  You will need to do this separately for each one.

2.) No, it's in the content tab.  Right click My Library or any tab under that and choose "refresh."


bruce32466 ( ) posted Mon, 13 February 2012 at 5:29 AM

Thanks.


razvanab ( ) posted Wed, 22 February 2012 at 7:19 PM

Hi millighost !

**
**

Is there any chance to update the script for the last version of blender 2.62 ?

 

Thank You


millighost ( ) posted Fri, 24 February 2012 at 5:58 AM

Quote - Hi millighost !**
**

Is there any chance to update the script for the last version of blender 2.62 ?

...

Sure, i could. But the old version still works (i tested with 2.62 from svn today). Do you have any specific problems?


razvanab ( ) posted Fri, 24 February 2012 at 8:09 AM

I tried with the last version 2.62 and i get this error

http://img407.imageshack.us/img407/7108/blendv.jpg

 

 

 


millighost ( ) posted Fri, 24 February 2012 at 8:19 AM

Quote - I tried with the last version 2.62 and i get this error

http://img407.imageshack.us/img407/7108/blendv.jpg

This error is raised by the script complaining it cannot find a "geometry_library" in the file it tries to load (i.e. the file does not have a mesh in it). Most likely you tried to load the wrong dsf file. After you installed Genesis using daz's installer, you will have two files called Genesis.dsf:

<install-directory>/data/DAZ 3D/Genesis/Base/Genesis.dsf and
<install-directory>/People/Genesis/Genesis.dsf

You need to use the one in the data directory (first line), not the one in the People directory. Could this be your problem?


razvanab ( ) posted Fri, 24 February 2012 at 11:37 AM

Yes indeed i was trying to load the one from people...

Thank You ! 


MWMPHX ( ) posted Sun, 26 February 2012 at 4:03 PM · edited Sun, 26 February 2012 at 4:06 PM

file_478939.txt

Superb work millighost. I was up all night playing : ) I registered an account here just to thank you.

Notes:

You can work on related morphs by giving each one it's own key and hiding all but the one you want when you export. As millighost notes above, you can see the other morphs in edit mode so I am a very happy camper with this setup. Model me with a huge grin.

Filename becomes the hidden internal name (as opposed to the exposed label designated by the shape key name) for the morph. So, for instance, I save the .dsf with MWM as the first three letters in the filename so all my custom morphs can be isolated when doing an FBX export.

X mirror the mesh for symetric morphs. BTW, proportional editing (o) doesn't work in X mirror.

Now we need to share our morphs : D. I'm working on a face modeling set. Here's one y'all will surely want. Just delete the .txt extension and stick it in the morph folder or a subfolder of that folder


MWMPHX ( ) posted Sun, 26 February 2012 at 4:09 PM

Additional note:

Whatever value range you assign the shape key in Blender becomes the default range in Studio.


MWMPHX ( ) posted Tue, 28 February 2012 at 2:23 AM · edited Tue, 28 February 2012 at 2:35 AM

You can open up a .dsf in a text editor. Notepad ++ works better than regular notepad for this—it can read all the code and give it a clean nested look. The format looks like .json and it's not too hard to figure out the structure.

This means you can make a symetric morph of, say, a smile wrinkle, make two copies of it, and delete the negative vertices in one and the positive in the other so you have one for each side too.

Now I need an easy way to calculate bone push values to go with some of the more radical morphs. : )

P.S. Don't forget to halve the "count" value when modifying the .dsf. (Not the "vertex_count"!)


millighost ( ) posted Tue, 06 March 2012 at 6:23 PM

file_479210.jpg

Here is a little update to the morph exporter script; i have made some changes and a few additions:

  1) i added a script to load morphs as shapekeys, so you can create morphs that are based on other morphs (like Victoria 5 for example).
  2) i added a script to load uv coordinates for the imported figures. It does not load textures, you have to do that manually, but the UVs are there, so you could use blender's projection painting on Genesis.
  3) i packaged the scripts into a single directory (with lots of files in it), which makes maintenance easier.
  Here is a step by step how to handle these:

  Only if you have the old version installed:

  If you have the two scripts 'export_dsf_morph.py' and 'import_dsf_geom.py' (old version of this stuff) installed, best is to remove them first; disable them in the user preferences by unchecking the checkmark (illustration), then remove the scripts from your blender addons directory.


millighost ( ) posted Tue, 06 March 2012 at 6:26 PM

file_479212.txt

After that, unpack the attached zip-file into your contents into your blender addons directory (it is named with a .txt extension because this forum does not seem to allow attachment of .zip files). On my system that would be

    v:/blender262/2.62/scripts/addons

  If you are running linux, you can unpack it into your personal blender directory:

    ~/.blender/2.62/scripts/addons

  The zip contains a subdirectory 'dsf', so after unpacking you should end up with a directory like v:/blender262/2.62/scripts/addons/dsf. The exact path, of course, can be different for your system.


millighost ( ) posted Tue, 06 March 2012 at 6:27 PM

file_479213.jpg

In blender's user preferences (in the addons tab in the Import-Export category) you should have one entry named dsf-utils. Enable it by clicking the checkmark. There is only one common checkmark for all the different import/export options.


millighost ( ) posted Tue, 06 March 2012 at 6:28 PM · edited Tue, 06 March 2012 at 6:37 PM

file_479214.jpg

Now you have all the features enabled. The usage of the operators for importing a dsf geometry file (import dsf-geom) and exporting a shapekey (export dsf-morph) have not changed from the previous version (see the start of the thread), so i concentrate on the new functions:

To import a morph into blender, first you select the genesis mesh in the viewport, then you select the 'dsf-morph (.dsf)' entry from the menu (illustration) (the operator is called 'import dsf-morph'), which will open a file dialog, which you need to point to a DAZ-Studio file containing a morph.


millighost ( ) posted Tue, 06 March 2012 at 6:32 PM

file_479215.jpg

The morph files for Genesis are somewhere in the data-directory of your DAZ content installation, usually in a subdirectory named 'Morphs', sometimes they are not that easy to find, because they are scattered all over the place, and they have no definitive name (all dsf files end with '.dsf' but apart from that one cannot tell what some file contains without actually looking into it, so you might have to guess now and then. But files starting with PHM (partial head morph) or FBM (full body morph) are likely to contain morphs. In the screenshot i used the Aiko4 morph, which is located in "data/DAZ 3D/Genesis/Base/Morphs/DAZ 3D/Aiko 4/FBMAiko4.dsf" within the daz studio data installation directory. Click the 'import dsf-morph' button in the upper right to load the morph.


millighost ( ) posted Tue, 06 March 2012 at 6:33 PM

file_479216.jpg

The morph gets loaded as a shapekey (visible in the mesh-properties panel), and will be based on the base shapekey of the mesh. If no base shapekey is defined, the script will create one. If you select the Aiko 4 shapekey and dial the value to 1, you will see the morph applied. Note, that this script only loads the morph, and no poses; some Genesis characters not only contain the morph, but addionally an automatic pose (usually to make Genesis or parts of it smaller), but this script does not handle this.


MWMPHX ( ) posted Tue, 06 March 2012 at 6:43 PM

You da man.

Now to go play.


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.