Creating Morph Targets with Blender 2.6

jlamarchejlamarche Posts: 0
edited December 1969 in The Commons

I've been experimenting with creating morph targets for Daz Studio 4.5 using the current version of Blender (2.63a). After hitting a fair few snags along the way, I figured out the process and thought I'd share the approach that worked for me in a little tutorial.

There are a few issues that need to be accounted for between Blender and Daz Studio: different coordinate systems, scale, and making sure you build your morph on top of the proper base mesh.

To start, open up the base model you want to modify in Daz Studio. This will usually be the base figure (such as Genesis or Victoria 4) with no morphs applied. You may choose to build on top of an existing morph, like Victoria 5 or Michael 5, but if you do, that morph becomes a prerequisite for yours. If you apply yours without it, it will look wrong. You should have just the base model with no props or accessories in your view.

From the File menu, select Export. Choose the name and location where you want to export the base model, and select COLLADA (*.dae) for the export type. All of my early attempts to export the base model used Wavefront .OBJ, but using that file format at this stage caused problems. Collada preserves the vertex order (which is important), preserves scale, and doesn't apply bone transformations to the mesh when exporting, so it seems to be the best choice.

When the Collada export dialog comes up, make sure to turn off Bake scale and all the options below it. You don't need textures or animations to create a morph target and they'll just get in the way. Your dialog should look something like this:

Once you've exported the file, go over to Blender. You can leave Daz Studio open if you wish, or you can re-open it later and load the same mesh you exported . If there are any objects in your scene, press the A key to select all and then the X key followed by the return key to delete. You'll now have an empty scene to work with. In the File menu, look for the Import… sub-menu and then select Collada (.dae) or Collada (Default( (.dae) (the name you'll see will depend on which version and branch of Blender you're using). There shouldn't be any import options, but if there are, use the defaults. Select the base file you exported in the last step.

The file will open up and you'll see the base model and its armature, but they'll be laying on the floor instead of standing up. This has to do with the fact that Blender uses a Z-up coordinate system and Daz Studio uses a Y-up coordinate system. We can account for that difference by rotating 90° on the X axis, which we'll do in a moment.

But first, we don't need the armature for creating a morph target, so right-click on the armature to select it and hit the X key on your keyboard followed by the return key to delete it.

Next, rotate the base figure so it's in Blender's coordinate system. Right-click on the base figure and press the R key on your keyboard, followed by the X key (which constrains the rotation to the X-axis) and then the 9 key and the 0 key (which tells blender to rotate 90 degrees on the chosen axis). Press return to commit the rotate. This should stand the mesh up. With the mesh still selected, press control-A and choose Rotation from the menu that pops up. This applies the rotation so that the new rotated position is the default position for this object.

Now you're ready to create your morph target using Blender's vertex modeling tools. You have to limit yourself to manipulating existing vertices. You can't delete or add vertices, edge loops, faces, or edges. You can work in vertex, face, or edge mode and move everything around as you will, but you have to restrict yourself to moving. You can also use Sculpt mode if you wish, however don't use a multiresolution modifier or, for that matter, any modifiers.

Once you're happy with your changes, right-click the modified object and select the Export submenu from the File menu and choose Wavefront (.obj). The next two steps are important. We have to make sure that we're exporting with the correct options to account for the differences in Blender's and DS's coordinate systems.

In the options in the lower left, we need to make sure that the Keep Vertex Order checkbox is checked, that Scale is set to 1.0, the Forward: dropdown menu is set to -Z Forward, and the Up: dropdown menu is set to Y Up. Here are the options I used to export my morph target.. You can name the file whatever you want, however the filename (without the .obj extension) will be what is used to name the morph in Daz Studio, so it's best to choose something descriptive.

Back in Daz Studio, select the base figure if it's not still selected. If you closed Daz Studio, reopen it and load up the same figure you exported earlier. Now, choose Morph Loader Advanced… from the Figure submenu of the Edit menu. Hit the ... button and select the morph target you just saved. Make sure the Scale is set to 100% and make sure the Swap Y and Z Orientation checkbox is NOT checked. Now hit Accept.

The Morph Loader will create a new parameter dial named after the file name you chose earlier. If you spin it, the shape should change to the morph you created in Blender.

If you prefer using Morph Loader Pro instead of Morph Loader Advanced, you can. Just make sure Scale is set to 100% and that you use X for the X axis, Y for the Y Axis, and Z for the Z Axis, with none of the axes inverted. We've already accounted for the difference in coordinate systems when we exported the morph target, so you don't want to do any conversion here at all.

I hope that helps someone.

«1

Comments

  • Mosk the ScribeMosk the Scribe Posts: 888
    edited December 1969

    Thanks. I actually got my 3D start in Blender before moving to DAZ and Carrara. Will tuck your notes away and give it a try at some point.

  • jestmartjestmart Posts: 4,449
    edited December 1969

    Blender's Wavefront object importer and exporter have option for keeping vertex order. I have always used wavefront, and I don't have to jump through extra hoops do to rigging.

  • jlamarchejlamarche Posts: 0
    edited August 2012

    jestmart said:
    Blender's Wavefront object importer and exporter have option for keeping vertex order. I have always used wavefront, and I don't have to jump through extra hoops do to rigging.

    Generally, I've used OBJ for morphs in the past with the keep vertex order option you mention. Unfortunately, I've found that using Wavefront for the base mesh causes problems when I try to load the morph. Using Collada doesn't have that problem, and has the added benefit of not having to account for scale differences.

    If you're getting Wavefront export to work, though, I'd be curious to know what settings you're using.

    I'm not sure what you mean by "jump through extra hoops". Wavefront OBJ doesn't support vertex weights, so you lose all skinning data. It seems to me, if anything, Wavefront makes you jump through more hoops with rigging, unless you're talking about rigging to a different armature.

    Post edited by jlamarche on
  • jestmartjestmart Posts: 4,449
    edited December 1969

    The 'extra hoops' is having to delete the armature since it isn't there with wavefront.

    I just did a morph for the horns of the new Tauren II and took some screen shots as I went. Because these are Genesis figure geografting prop the sub-d has to be set to Base Level and 0 sub-d before exporting. When exporting the scale is very important, set to Custom 100%, don't get confused by all the program specific preset scales.

    DS_WavefrontExport.jpg
    487 x 526 - 57K
  • jestmartjestmart Posts: 4,449
    edited December 1969

    When Importing the horns in to Blender using wavefront the only setting that need to be checked is 'Keep Vertex Order' and 'Poly Groups'. Don't worry about the z-axis thing, the exporter un-flips it automatically.

    Blender_WavefrontImport.jpg
    244 x 277 - 23K
  • jestmartjestmart Posts: 4,449
    edited December 1969

    Remember when making the morph not add or subtract verts or do anything drastically alter scale or location. Once done time to export, the exporter has few more options then import. I check 'Selection Only' and 'Include UV' more out a sense precaution, the only ones that really need to be checked are 'Poly Groups', 'Objects as OBJ Objects' and 'Keep Vertex Order'. Again don't mess with the z-axis

    Blender_WavefrontExport.jpg
    244 x 538 - 31K
  • jestmartjestmart Posts: 4,449
    edited December 1969

    Finally when bringing back to Studio the most important thing is the scale, Custom 100%. Locate your morph target, hit accept and everything should work.

    DS_WavefrontImport.jpg
    485 x 727 - 59K
  • edited April 2013

    Can you help please? I got Genesis into Blender ok, and made his head fat on each sixe. Saved it with the exact settings and called it BigHead. I used Morph loader pro but after the dial gets created, the entire Genesis figure just grows and shrinks.
    Any idea what could cause this?

    After the model gets tiny, his head morph works. LOL, but I'm clueless.

    Post edited by garyp156_91954b7311 on
  • jestmartjestmart Posts: 4,449
    edited December 1969

    You changed the scale, use Custom 100% and don't mess with the axis stuff.

  • kitakoredazkitakoredaz Posts: 3,526
    edited December 1969

    Hi,, it seems good timing,,,, because I have same problem about exporting obj to make morphs.^^;

    usually I have no problem about exporting as obj from ds. and make morphs by blender too..
    I need to set option , as vertex order, and poly group.and uncheck Ngon Lines Smooth Groups.
    As jestmert mentioned. (As for me,, I export 1% scale from ds, and keep default in blender scale,,
    after modify it,,then export same size from blender., then import it 10000% to ds.)

    but about some case,,
    imported obj shows many flying vertices. ( I think when I export obj which made as cr2 figure,,,
    there are many fly away vertices. )

    and these vertices (unused?) are not assgined any material group.

    I tried many export and import option, but if I remove these vertices (they are separate from base mesh in blender)
    by change export option from daz studio,,,,the exported obj can not be used as morph .
    (these vertices are real vertices , so that if I remove them it change counts,,, ).

    if I export obj to hexagon ,there seems no problem or, I can not find these flying vertices,,,

    so,,Is there any good setting, ,and I want to know,, why it happen ? I think,,when I set option keep vertex order in blender,
    it make these flying vertices,, but the option must need to make morphs,,@@;

    I apply my setting pic,,too.

    fromdaz2.JPG
    262 x 315 - 22K
    fromdaz.JPG
    543 x 544 - 55K
    flyingvertices.JPG
    833 x 654 - 214K
  • kitakoredazkitakoredaz Posts: 3,526
    edited December 1969

    Now I find when I use auto-fit (or it may happen about reshape figure by transer utility)
    about cr2 figure,, then export zero shape of the figure which modified for genesis shape to blender.

    (before export the shape, I saved it as duf figure and prop,, to keep the shape)

    About genesis auto-fitted shape obj , these flying vertices can visible in edit mode.
    but original shape obj (for A4) which exported from cr2 figure,,
    there seems no flying vertices,,,

    So that,,, Auto fit defomation process make these unused vertices?
    if I export same obj to hexagon,, there seems no flying vertices,,, (or I can not visilbe,,)

    .

    flying3.JPG
    1223 x 720 - 142K
  • edited May 2013

    I just did the same thing again. BTW I'm using morph loader pro.
    Here's my import screen using 100%. I even created a preset for it.\


    Same thing happens. He shrinks. I'll play a bit more and see if there was something else I could have screwed up.

    Optionsscreen.JPG
    527 x 612 - 52K
    Post edited by garyp156_91954b7311 on
  • edited May 2013

    I've been at this for a while now, trying import sizes and options. There seems to be only one option for export from DS.
    I made sure when I exported from Blender that I set it on 100%, then in MLPro I set it to 100% again, but my Genesis still shrinks.

    Edit:
    He also lays on his back when morphed, so I followed the directions to rotate him in Blender and it was really hard to move around and morph but I managed to give him a belly. Same thing, exported at 100%, then imported then slid the dial and he got really tiny. AND flattened out like paper. Himmm, this was new.

    Post edited by garyp156_91954b7311 on
  • jestmartjestmart Posts: 4,449
    edited December 1969

    You are flipping the z and y axis, remember KISS, Keep It Simple Stupid (no I'm not insulting anyone that is just what is stands for). Kitakoredaz I must of missed your earlier post. I don't know why Hexagon does not show those verts but I assure you Blender is not creating them. Under your export from DS for groups I would suggest check either Use Existing Groups or Use Node Name(s). Existing Groups works best for newer content, stuff made after the release of Poser 8. Use Node for content made before release of Poser 7. And just to be clear I am using Poser 7 and 8 release dates as timeline reference points, nothing more. Furthermore these are what generally works but you never really know til you try it so before putting in a lot of hard work creating a morph only to find the import/export options where wrong do a simple test morph first.

  • edited December 1969

    I've tried it both ways now. Flipping and not flipping. I'm trying exporting as an obj at the moment but the Y & Z are flipped. You have to flip on the return. BTW, I've done this in Hexagon but I wanted to use a different modeler.
    It has something to do with the Callida I'm thinking.
    If I can't get it to work, I'll post what I have tried. If we had any good documentation that would be helpfull.

  • edited December 1969

    Interestingly enough, the answer was in the Callida because when I tried it with the OBJ exporter and Blender's OBJ importer as jestmart suggested it worked without a hitch. No more scaling of the figure, but as a side note, the Blender scene is huge. No worries on my part.
    Hope this helps someone. I'd still be interested to know how to get Callida to work.
    BTW, DS 4.5.1.56 Pro | Blender 2.66

    04_daz_import_4.JPG
    563 x 595 - 57K
    03_blender_export_4.JPG
    230 x 510 - 25K
    02_blender_import_4.JPG
    231 x 279 - 20K
    01_daz_export_4.JPG
    500 x 560 - 53K
  • kitakoredazkitakoredaz Posts: 3,526
    edited December 1969

    First thanks much jestmart @@; yes,, I wanted to know the option,, which option is really good,, about cr2 clothings
    and Blender,,, I must try to Use Existing Groups .
    I know,,it seems different ,cr2 clothings for V4 m4 etc, and duf product clothing for genesis.
    this A4 cardigan is already changed to triax weigth map for genesis in ds,
    but there seems difference about making geometry,, cr2 clothings and duf clothings..
    (I sometimes see these problem,, after change weight map to triax, and save duf to tweak more,,
    eg apply smoothing modifier,, cr2 converted figure surface move away from welded part,,,)
    I am only genesis user ^^; I can not study so differnt figure from now,,, ^^;
    I have never tweaked poser at atll,,so it is difficult understand about these cr2 geometry,,,,)

    ==============================================================

    Gary p,,,,I understand,, when I first try to make morph by blender,
    everytime I missed something about scaling and genesis or clothing turn X, Y,Z strange way.
    I almost gave up it before.

    then I asked how to in this forum, then I can get the way fit to me.
    (I know there are many setting which may work for each user)
    As for me,, it works better when export genesis (and clothings etc) with 1 % scale from daz studio.

    then when I import obj to blender,, I do not touch the scale setting. in blender.
    keep clamp size (0.00). it is ok. do not need to change it.

    it is same,, when I export obj from blender, I do not touch the scale. in blender.

    and you do not need to change X Y Z, as jestmart told you,,,. when you import or export from daz studio.(morph loader pro too)
    it auto change and invert ,, when you choose preset Blender in daz stuidio,, so that you must need to check again
    I did same mistake again and again,, untill I understand it. ^^;)

    and you do not need change X Y Z in blender too. it auto adjust at default.
    Foward -z Foward, up Yup.

    But you need to adjust scale when Import the obj to ds by morph loader pro again.
    (I export obj 1% from daz studio, so that I need to import obj 10000% when use morph loader pro to import morph target )
    if you export obj 2% = you may need to import obj 5000% to ds.)

  • edited December 1969

    Thank you kitakoredaz.

    This morning I tried using export and set it To Blender. It changed the Y and Z so I changed it back to Y=Y and Z=Z.
    I imported it into Blender with no changes. i.e. Blender was set at Zup and Y forward as usual.
    Genesis came in fine, pointed up in the right direction and not huge as before.
    I think it was the Calida that was messing with me. I did not have to delete the bone either.
    I changed the mesh then exported from Blender and changed nothing. I left the default settings.
    I did a test import of the character into daz studio, setting the scale From Blender. It changed the Y and Z so I changed it back to Y=Y and Z=Z. without using MorphLoader and it came in fine.
    Then used Morph Loader Pro with the same settings, From Blender and being careful to change the Y and Z, and it came in with an error that the geometry did not match.
    I imported the exact model I exported and that did not work either. Something in the export is messing up the geometry.
    I thought it was because my mesh resolution was not set to 0, but I set it.
    Tonight I'll mess with it more. Off to work for me. :(

  • jestmartjestmart Posts: 4,449
    edited December 1969

    Did you remember to set Genesis to Base Resolution before exporting?

  • edited December 1969

    jestmart said:
    Did you remember to set Genesis to Base Resolution before exporting?

    Thank you!

    Grrrrrr No, I forgot. It doesn't seem to matter on the way in, but on the way out it does.
    I used the exact settings I used above this morning except I picked the Blender scale and changed Y=Y and Z=Z, then used the same settings I used above for import and export, and it didn't work. He still wants to lay on the floor. Who came up with this stupid Z forward thing? Z has always been up in science since time began.

    I don't much care for DAZ's new forum. It doesn't remember me and I can't seem to add photos in order like I used to.
    I'm not sure what the other settings do but I'll experiment tonight when I get home. RL calls.

  • jestmartjestmart Posts: 4,449
    edited December 1969

    Simply stop using Blender scale, use Custom 100% for export and import. Sure it will be huge in Blender, so what, it doesn't have that much impact on the modeling tools functions, sculpting even works better at the huge size.

  • edited June 2013

    Hello guys! I am having a problem with creating a morph for some clothing using this technique.

    When I try to load the morph on the original figure I get the error “One or more of the files loaded had no effect. See log for details.”

    The log shows this information:

    "File loaded in 0 min 3.5 sec.
    Loaded file: Test Jsuit Collada to Daz.obj
    WARNING: QLayout: Attempting to add QLayout "" to DzMorphLoadDlg "Morph Loader Advanced", which already has a layout
    Reading Test Jsuit Collada to Daz.obj
    Morph Loader reported no effect for the following file(s):
    C:/Users/Joseph/Desktop/Test Jsuit Collada to Daz.obj
    WARNING: QLayout: Attempting to add QLayout "" to DzMorphLoadDlg "Morph Loader Advanced", which already has a layout"

    I followed the method very closely, and I didn't seem to have any scaling issues. I also made sure that when I exported the figure that mesh resolution was set to 'Base'. Any ideas? Anyone else able to replicate this issue?

    EDIT: I forgot to mention, the two lines in the log that read "Morph Loader reported no effect for the following file(s):
    C:/Users/Joseph/Desktop/Test Jsuit Collada to Daz.obj" seem of particular interest. There's definitely been changes made to the model.

    EDIT 2: I just wanted to report I was able to get it working with a different figure (a simple prop), so I don't think I'm doing the method incorrectly. It must be something specific on this clothing item that is causing the issue.

    Post edited by joeshelton0001_f3a8ae879b on
  • jestmartjestmart Posts: 4,449
    edited December 1969

    If you are using Collada format stop, use Wavefront object. Collada, like fbx, are attempts at universal 3D file formats capable of transfers not only mesh data but also rigging. For a morph only the mesh data is needed so Wavefront is enough. Now why did a simply prop work when clothing didn't, I would guess do to Grouping. A simple prop is likely to have only one group whereas clothing may have several groups. Be sure your import and export settings maintain the grouping as well as the vertex order.

  • edited June 2013

    That sounds really plausible. I know when I exported from Blender I had a maintain grouping checkbox checked (forgot the exact name), but is there a setting for maintaining grouping on export from Daz that I maybe missed?

    EDIT: Another user was able to get it to work with Genesis, but is having the same issue with other figures. Does Genesis use groups?

    EDIT 2: Ah, I see this picture now in Gary_P's post.

    http://www.daz3d.com/forums/index.php?&ACT=50&fid=4&aid=69324_pcWyFDBO1OJOCnjUHRqq&thumb=1&board_id=1

    I'll check my export settings when I get home and see if they match these.

    Post edited by joeshelton0001_f3a8ae879b on
  • CyberIllusionsCyberIllusions Posts: 5
    edited December 1969

    So I have tried every combination of scaling and no matter what I do it always either makes it shrink or grow

  • jestmartjestmart Posts: 4,449
    edited December 1969

    Don't mess around with scale. Custom 100% scale when exporting from DAZ Studio and Custom 100% scale when importing with DS's MorphLoader. Don't mess with scale when in Blender, there just no need to.

  • CyberIllusionsCyberIllusions Posts: 5
    edited June 2013

    Trust me I tried that. Tried it again right now, still shrinks it :/

    It stretches it in the z directions and shrinks it in the y

    Post edited by CyberIllusions on
  • Lissa_xyzLissa_xyz Posts: 6,116
    edited June 2013

    Trust me I tried that. Tried it again right now, still shrinks it :/

    It stretches it in the z directions and shrinks it in the y

    Try exporting as a Collada and when you import a Collada to blender, use "Import Units" option on the left side of the import screen. That's how I got the scale to remain.

    Post edited by Lissa_xyz on
  • jestmartjestmart Posts: 4,449
    edited December 1969

    That sounds like you originally picked Blender Scale when exporting which not only changes scale it also change y and z orientation. Go back to the first page of this thread to find the screen grab of export setting I posted, make sure yours are the same. Don't change the Forward and Up settings in Blender when importing or exporting. Don't rotate the figure in edit mode so y is up. And finally don't use Collada, stick with Wavefront.

  • CyberIllusionsCyberIllusions Posts: 5
    edited December 1969

    Used both and STILL same problem

Sign In or Register to comment.