How to Use dForce: Creating a Blanket, Draping Clothes on Furniture, and Much More [Commercial]

1192022242539

Comments

  • ImagoImago Posts: 4,874

    It already exists, Crios, you just have to look a bit in the net.

    Also, after seeing all these techniques and tricks, I wonder why the DForce stauff is still "for someone"... I mean, a DForce shirt can be fitted to ANY char, why bind it to a single char (and often a single morph)?

  • 3dOutlaw3dOutlaw Posts: 2,470

    I believe most dforce stuff is still conforming, but has dforce modifiers applied if you want to run a simulation.

  • KaribouKaribou Posts: 1,325
    barbult said:

    How I got dForce Dynamic Surface Add-On working with polygons

    @Mada posted several dForce Dynamic Surface Add-On tips in this thread, and she also used the technique in her House Brownie Outfit  I purchased that outfit, and it was a good example of what dForce Dynamic Surface Add-On polygons should look like and how they should be positioned. She used them to hold a shirt closed, at the button locations, as if the shirt were really buttoned. This is a summary of what I learned from her generous tips. There may be better ways. I used Blender, and I am NOT a Blender expert, so I might have made things harder than necessary. These steps assume some basic knowledge of exporting and importing OBJ files in Daz Studio, using a modeler like Blender, and using the Transfer Utility. 

    1. Open the garment/object that you want to add the dForce Dynamic Surface Add-On to. In my case, I used the dForce Dynamic Surface Add-On to hold a shirt front closed, like Mada did in House Brownie.
    2. Change the Mesh Resolution of the object to Base and turn off Smoothing.
    3. Export the object as OBJ. I used the same export settings that I would use if creating morphs for the object.
    4. Import the OBJ in your modeler. I used Blender. I used the same import settings that I would use if morphing the object.
    5. In Blender, select the imported object, go to edit mode and vertex selection method.
    6. Select a vertex in one side of the shirt (e.g. the right side near the button).
    7. Shift-Select a vertex on the other side of the shirt (e.g. the left side of the shirt near the button hole).
    8. Shift-Select another vertex on the second side of the shirt (e.g. the left side of the shirt near the button hole).
    9. Shift-Select another vertex on the first side of the shirt (e.g. the right side near the button).
    10. Now you have four vertices of the shirt selected, two on one side of the shirt and two on the other side. Hit the F key to create a new polygon from these 4 vertices.
    11. Switch to face selection mode. Select ONLY the new polygon that you created.
    12. Hit Ctrl I to invert your selection. Now you have the entire garment selected and your new polygon is NOT selected.
    13. Delete all of the selected faces.
    14. Now you have only your new polygon left.
    15. Export that new polygon as an OBJ file. I used the same export settings I would use if exporting a modified mesh for morph creation.
    16. Return to Daz Studio and import the OBJ file containing your new polygon. I used the same import settings that I would use if importing a mesh for creating a morph (the same scale as used for exporting, etc.).
    17. Use the Transfer Utility to conform the new polygon to the original garment (Source: original garment, Target: new polygon object).
    18. With the polygon object selected in the Scene pane, Add dForce Modifier: Dynamic Surface Add-On (Edit/Geometry menu).
    19. If the original garment didn't already have dForce Dynamic Surface(s), add dForce Modifier: Dynamic Surface to it (Edit/Geometry menu).
    20. Return the Mesh Resolution to its original setting if you changed if from High Resolution to Base in step 2.
    21. Simulate and you should see that the new polygon dForce Dynamic Surface Add-On holds the two sides of the shirt together, because two vertices were on one side and two vertices are on the other side, preventing it from falling open at that location.
    22. Turn Smoothing on for the original garment if you wish.

    I did this from memory. I hope I didn't forget any critical steps! 

    I have to try this now.  Darn you. I hate it when things sound simple enough that I can no longer pretend I just don't understand them, lol.

    I wish Studio's geometry editor could just merge polys or delete vertices.  (I realize that doing so is probably a much bigger "software deal" than it sounds like it should be.)  But it would be SO much easier than all that import/export business.

  • RGcincyRGcincy Posts: 2,805
    Mada said:

    @RGcincy - glad you got it to work :) 

    Thanks Mada. The add-on was mysterious until you and barbult shared how it works. Now I can experiment with how and where to use it.

  • barbultbarbult Posts: 23,049
    RGcincy said:
    Mada said:

    @RGcincy - glad you got it to work :) 

    Thanks Mada. The add-on was mysterious until you and barbult shared how it works. Now I can experiment with how and where to use it.

    With your experimentation skills, I bet you'll find some great new uses. I look forward to what you figure out!!!!

  • felisfelis Posts: 3,574

    I have this exact problem: trying to do open/close on dforce items.

    I followed above steps but cannot get it to work.
    Difference is that I modelled the object in blender too. And then added a new object (the polygon to close the mesh).
    Then importing it into Daz, first the clothing and then the 'locker'.
    And then first transferred the clothing to Daz character, and next transferred 'locker' to clothing..

    But the result is that the 'locker' in the simulation drops down on its own independant of the clothing..
    Looking at the clothing and the 'locker' prior to simulation in wireframe there is a perfect match on vertices.
    After simulation and clear simulation there is a sligth gap for some vertices.

    But basically, the polygon does not stick the the clothing (mesh).
    Any ideas why, and how to correct it?

  • barbultbarbult Posts: 23,049
    felis said:

    I have this exact problem: trying to do open/close on dforce items.

    I followed above steps but cannot get it to work.
    Difference is that I modelled the object in blender too. And then added a new object (the polygon to close the mesh).
    Then importing it into Daz, first the clothing and then the 'locker'.
    And then first transferred the clothing to Daz character, and next transferred 'locker' to clothing..

    But the result is that the 'locker' in the simulation drops down on its own independant of the clothing..
    Looking at the clothing and the 'locker' prior to simulation in wireframe there is a perfect match on vertices.
    After simulation and clear simulation there is a sligth gap for some vertices.

    But basically, the polygon does not stick the the clothing (mesh).
    Any ideas why, and how to correct it?

    I don't know. Maybe you should use the transfer utility to rig the clothing to the character, save it as an asset, export it again and then create the locker polygon to match the vertices to the rigged re-exported clothing. That would be a process closer to using a piece of clothing from the Daz store.

  • MadaMada Posts: 1,855

    I'm still experimenting a lot with add-ons and it sometimes take a couple of tries to get the add-on to stick. Usually when something like your problem happens there could be a couple of reasons.

    1. The vertexes are just slightly off - that's why I worked out the method of adding the polygons to the existing obj instead of a separate one because it had to be perfect to work. You can also try to select just the new polygons without deleting the original and copying and pasting them to a new obj, sometimes deleting the obj changes the points just a bit and then it won't work that well anymore. 

    2. Make sure you're using the latest version of DS.

    3. Double check that the add-on is set as an add-on in the dforce settings. The add-on is supposed to be hidden after the sim for rendering, so if your item is actually staying closed and all that's happening is that the add-on is not an exact match anymore after the sim that is correct, especially when you have smoothing turned on in the item. It only has to be exact match before the sim. If you can see the add-on in a completely different spot from the clothing item after the sim then its not working.

  • RGcincyRGcincy Posts: 2,805
    Mada said:

    The vertexes are just slightly off - that's why I worked out the method of adding the polygons to the existing obj instead of a separate one because it had to be perfect to work. 

    I think this is important from what I've seen too. Close enough is not enough, has to be exact it seems. 

  • felisfelis Posts: 3,574

    Thank you for the replies.

    It is embarrassing. I had not used the dforce modifier add-on, just the dforce modifier.

    Now it is working fine.

  • RGcincyRGcincy Posts: 2,805
    edited August 2018

     

    55. Using a Dynamic Surface Add-on. There are three dForce modifiers: dynamic, static, and dynamic add-on. The last one is not explained anywhere and it was only through the postings by Mada and barbult on the Daz forums that I learned how to use it - a big thanks to both!

    For a detailed list of steps using Blender and a wardrobe item (shirt in her case), see barbult’s post. Since clothing has more complex geometry that may hinder understanding how the add-on works,  this tutorial section uses a simple cylinder made in Silo and imported into Daz Studio (other modelers should have similar tools although they may use different names).

    Silo Steps

    a. Choose Create/Cylinder/Opt from main menu of Silo. Set parameters as shown. Left-click on create.

    b. Using the face selection mode, click on the end faces and delete both.

    c. Use the edge selection mode and choose a vertical line in the top row of the cylinder and then holding down the Shift key, do the same in the bottom row, directly below the first edge. Select the path (Alt+T).

     

    d. From the main menu, choose Modify/Break to split the cylinder down the path.

    e. Use the face selection mode and choose the faces to the left of the split. Move them slightly forward and then to the right so they overlap the right faces but with a small gap.

    f. Select the cylinder and save it by going to the main menu and choosing File/Save Selected Objects…

    g. Zoom in towards the upper part of the cylinder. Choose the polygon tool (menu Create/Polygon Tool). The mouse icon will change to a diamond. Click on a vertex (the 4th one down) on the left edge, then click on a vertex on the right side, then one in the 5th row on the right side, and then the fifth one down on the left edge (see green area in image). Hit Enter to create the polygon and Esc to exit the tool. The newly created polygon is now a part of the cylinder object.

    h. Use the face selection mode to select the just created polygon. Then go to the menu and choose Selection/invert Selection to deselect the polygon and select the cylinder.

    i. Hit the delete key. You will be left with only the lone polygon. Save it by going to the main menu and choosing File/Save Selected Objects…  If you want to create another polygon, type Ctrl+z to undo and restore the cylinder.

     

    Daz Studio Steps

    j. Import the cylinder into Daz Studio (use From: Silo to import it with the right dimensions). Repeat for the polygon.

    k. With the cylinder selected, go to the main menu and choose Edit/Object/Rigging/Convert Prop to Figure.

    l. Go to the main menu and choose Edit/Object/Transfer Utility…

    m. In the Source drop down box, choose the figure we just created. In the Target drop down box, choose the polygon. This will make the polygon part of the figure.

    The scene pane will show the following structure:

    n. Select the cylinder and add a dForce dynamic modifier. Select the polygon and add a dForce dynamic add-on modifier.

    o. Select the cylinder and add a dForce weight node. Add the dynamic strength map. Paint a bit of blue on the upper left and right edges as shown in the image (remember to hold down the Alt key to remove the full-strength red). This will be enough to hold the cylinder in space during simulation.

    p. Run the simulation. You’ll see the split open up but it will be held in place by the add-on polygon. After the simulation you can hide the polygon or change its opacity to 0.

    In the image below, there are 3 different setups. The left cylinder shows what happens when there is no add-on, the middle one shows the result with one polygon, and the right one shows it with two polygons. You can see that if you were making a shirt, you could add a polygon at every button so the shirt would move in-between in a more realistic fashion.

    q. You may find you can skip steps k to m (making the prop a figure and using the transfer utility). For the figure above, just making the polygon a child of the cylinder was sufficient for it to work, but other times it fails. Not using the transfer utility also means the polygons may appear in a different position before the simulation than they will appear during the simulation, which can be confusing and lead to unexpected results. With what I know now, I’d recommend sticking to all the steps.

    r. For those without a modeler, I have figured out how to get the coordinates of vertices from within Daz Studio. An upcoming section will describe how to use that approach.

    dForce addon Silo create cylinder.jpg
    311 x 211 - 10K
    dForce addon Silo delete ends.jpg
    547 x 623 - 42K
    dForce addon Silo select 2 edges.jpg
    164 x 284 - 10K
    dForce addon Silo select path.jpg
    146 x 271 - 10K
    dForce addon Silo select move faces.jpg
    175 x 319 - 14K
    dForce addon Silo polygon tool.jpg
    263 x 270 - 11K
    dForce addon Silo select invert.jpg
    525 x 628 - 105K
    dForce addon Silo select invert delete.jpg
    205 x 178 - 5K
    dForce addon import objs.jpg
    418 x 502 - 15K
    dForce addon create figure.jpg
    553 x 220 - 39K
    dForce addon transfer util.jpg
    394 x 148 - 25K
    dForce addon transfer util selections.jpg
    576 x 222 - 42K
    dForce addon scene hierarchy.jpg
    434 x 118 - 20K
    dForce addon weight map.jpg
    405 x 488 - 17K
    dForce addon after simulation.jpg
    854 x 311 - 32K
    Post edited by RGcincy on
  • RGcincyRGcincy Posts: 2,805
    edited August 2018

     

    56. Finding Vertex Coordinates within Daz Studio. Many people have access to a 3D modeling application. If you do, the easiest way to create a polygon to use as an add-on is to create it in the modeler (like I did with Silo in section 55).  If you don’t have access to a modeler, all is not loss as you can hand-code a polygon.

    a. Go here and download and save the Geometry_Info script to your Daz Library Script folder. 

    b. Open the Script IDE pane from the main menu by selecting Window/Panes (Tabs)/Script IDE.

    c. From the Script IDE menu, choose File/Open Script… and click on Geometry_Info.dsa

    d. We are going to modify this script, so choose File/Save Script As… and give it the name Geometry_Info_Vertex_Coordinates.dsa.

    e. First delete lines 140 through 170.

    f. Next insert at line 140 the following:

         var oVertex;
         // Get the number of vertices
         var nVertices = oMesh.getNumVertices();
         // Iterate over the vertices 
         for( var i = 0; i < nVertices; i += 1 ){
              // Get the 'current' vertex
              oVertex = oMesh.getVertex( i );
              print( String("Vertex #%1").arg(i) );
              print( String("\t %1 %2 %3")
                   .arg( oVertex.x )
                   .arg( oVertex.y )
                   .arg( oVertex.z )
              );

    g. Choose File/Save Script.  You only have to do these steps one time.

    h. To test the script and make a polygon, create a primitive cylinder in Daz Studio.

    i. Using the Geometry Editor, select the top faces. Right-click in the viewport and hide them (Geometry Visibility), then delete them (Geometry Editing.

    j. Change to the Geometry Editor vertex selection tool (the 3rd icon in the top row of the pane).

    k. Click on a vertex in the top row of the cylinder. Holding down the Ctrl key, select the vertex directly below. While still holding down Ctrl, select a vertex in the second row down on the opposite side of the cylinder, then choose the vertex directly above. You will have 4 vertices selected.

    l. To see which vertices you’ve chosen, click on the Details button in the tab right below the icons in the geometry editor. Make note of the numbers. Daz sorts the vertices in numerical order which is not necessarily the order you selected them in.

    m. Now run the script we modified before by clicking the Execute button. The results will be in the gray output box at the bottom of the IDE:

    (If this box is not showing, click on the small triangle at the bottom of the pane.)

    n. Scroll through the result box and find the line that matches one of your vertex numbers. Highlight the row of numbers, right click and choose copy.

    o. In a text editor (like Notepad for Windows), type the letter v and then paste the numbers you copied.

             v 16.933780670166016 57.9119987487793 25.34319305419922

    p. Repeat for the other 3 vertices.

    q. Next add f 2 1 3 4 to the text file. You should have something that looks like this:

              v 16.933780670166016 57.9119987487793 25.34319305419922
              v 16.933780670166016 60.959999084472656 25.34319305419922
              v -16.93378257751465 57.9119987487793 -25.343191146850586
              v-16.93378257751465 60.959999084472656 -25.343191146850586
              f 2 1 3 4

    r. Save the text file with .obj. You’ve just hand-coded a polygon!

    s. Import the polygon into Daz Studio. From the main menu, select Import and select the .obj file you just created. In the dialog box, be sure From: Daz Studio and Scale 100% are chosen.

    t. You should see the polygon show up in the correct position. If not, you likely did not copy the right vertex information. If the polygon seems to be twisted, swap the first two numbers in the “f” line.

    u. You can now continue with the steps j to p in section 55.

     

    Hopefully I haven't missed a step in the above. If I have, let me know and I'll update.

    geo editor vertex selector.jpg
    411 x 99 - 13K
    geo editor vertex details.jpg
    679 x 353 - 59K
    script ide.jpg
    529 x 666 - 132K
    script ide result box.jpg
    520 x 226 - 49K
    script ide vertex coordinates.jpg
    450 x 149 - 35K
    obj import.jpg
    501 x 437 - 60K
    imported polygon.jpg
    555 x 322 - 45K
    Post edited by RGcincy on
  • You don't need step k - step l will work fine with the polygon still a prop.

  • RGcincyRGcincy Posts: 2,805

    thanks Richard

  • RGcincyRGcincy Posts: 2,805
    edited August 2018

     

    57. Button and Collar Add-ons.   To continue exploring add-ons, I modified a shirt I previously made in Silo. Now I have a much deeper appreciation for those who create clothes for 3D figures. Whew, not easy! I took the shirt and split it down the front, then overlapped the edges and added a collar. For the front gap, I added 7 polygons where buttons would be. For the collar, I added 5 polygons (1 at each collar tip, 1 on each side, and 1 in the back). I then ran frame 0 and animated dForce simulations.

    a. Here is a view of the shirt at frame 0 (click on images for larger images).

      

    b. Here is where the polygons are located. They are two different objects, so you can hide either or both.

     

    c. Frame 0 Simulations. The shirt drapes open and the collar turns up without add-ons. With the collar add-on, it stays down (for easier compariosn, click on each image and they will open in a new tab, and you can click through them to see the changes).

    No Add-ons:                                                                                With Collar Add-on:         

     

    With Collar and Shirt Gap Add-ons:

     

    d. Frame 30 Simulations. An extreme pose showing a lot more folding in the shirt.

    No Add-ons:     

           

    With Shirt Gap Add-on:

      

    With Collar and Shirt Gap Add-ons: With the more extreme pose, the polygon at the collar was not enough to hold the gap together.

      

     

    e. Finally I used the Geometry Editor to hide the top 2 and bottom two polygons of the shirt gap add-on to give it a more open look.

    dForce collared shirt frame 0.jpg
    512 x 640 - 105K
    dForce collared shirt poly locations.jpg
    512 x 640 - 129K
    dForce collared shirt no addons frame 0.jpg
    512 x 640 - 113K
    dForce collared shirt w c addon frame 0.jpg
    512 x 640 - 114K
    dForce collared shirt w addons frame 0.jpg
    512 x 640 - 108K
    dForce collared shirt with no addons front.jpg
    512 x 640 - 144K
    dForce collared shirt with no addons.jpg
    512 x 640 - 133K
    dForce collared shirt with no c addon front.jpg
    512 x 640 - 143K
    dForce collared shirt with no c addon.jpg
    512 x 640 - 132K
    dForce collared shirt with addons front.jpg
    512 x 640 - 142K
    dForce collared shirt with addons.jpg
    512 x 640 - 131K
    dForce collared shirt hidden polys front.jpg
    512 x 640 - 144K
    Post edited by RGcincy on
  • RAMWolffRAMWolff Posts: 10,142

    WOW.... nice!  

  • RGcincyRGcincy Posts: 2,805

    thanks! still lots to learn about the add-ons and how to use them, structure them, and understand what their surface properties affect.

  • RGcincy said:
    e. First delete lines 140 through 170.

    f. Next insert at line 140 the following:

         var oVertex;
         // Get the number of vertices
         var nVertices = oMesh.getNumVertices();
         // Iterate over the vertices 
         for( var i = 0; i < nVertices; i += 1 ){
              // Get the 'current' vertex
              oVertex = oMesh.getVertex( i );
              print( String("Vertex #%1").arg(i) );
              print( String("\t %1 %2 %3")
                   .arg( oVertex.x )
                   .arg( oVertex.y )
                   .arg( oVertex.z )
              );

    You might want to edit this to give soem sign posts, Rob does sometimes update scripts to take account of new features - and since this one is addressing geoemtry, and since geometry has chnaged with the addition of lines, it's quite possible the line numbrs will not be correct in the foreseeable future.

  • RGcincyRGcincy Posts: 2,805

    Thanks for pointing that out. I'll take a look at the script and see what would work as sign posts.

  • SylvanSylvan Posts: 2,681
    edited August 2018
    RGcincy said:

    This one is even better. I raised the sphere compared to the previous version. Got those nice diagonal pulls you would find from something heavy on something soft. Gravity was -0.1 

    Oh wow, I need to experiment with this as well! Looks great! Same goes for MrReclusive's render :O

    Post edited by Sylvan on
  • RGcincyRGcincy Posts: 2,805

    thanks Chohole, will have to take a look

  • RGcincyRGcincy Posts: 2,805
    edited August 2018

    Anybody get a polyline to work with dForce? I used the script Chohole posted and can see the polyline but I get the same result as I did for those I made - which is it doesn't hold like a polygon. Am I doing something wrong?

    Image showing polygon add-on:

    Image showing polyline add-on (green line):

    Simulation result, polygon on top, polyline on bottom (the black line above the lower cylinder is the polyline):

    dForce polyline start 2.jpg
    579 x 448 - 44K
    dForce polyline start.jpg
    396 x 215 - 29K
    dForce polyline.jpg
    451 x 650 - 104K
    Post edited by RGcincy on
  • MadaMada Posts: 1,855
    RGcincy said:

    Anybody get a polyline to work with dForce? I used the script Chohole posted and can see the polyline but I get the same result as I did for those I made - which is it doesn't hold like a polygon. Am I doing something wrong?

     

    Its still getting tweaked a bit, I hope to have something to show in a couple of weeks when I get back home :)

    I managed to get good results with using add-on supports to stop the tube from collapsing and made some necklaces to use with dForce.

  • barbultbarbult Posts: 23,049
    Mada said:
    RGcincy said:

    Anybody get a polyline to work with dForce? I used the script Chohole posted and can see the polyline but I get the same result as I did for those I made - which is it doesn't hold like a polygon. Am I doing something wrong?

     

    Its still getting tweaked a bit, I hope to have something to show in a couple of weeks when I get back home :)

    I managed to get good results with using add-on supports to stop the tube from collapsing and made some necklaces to use with dForce.

    I just bought your necklaces, but haven't had a chance to try them yet.

  • barbultbarbult Posts: 23,049
    RGcincy said:

    Anybody get a polyline to work with dForce? I used the script Chohole posted and can see the polyline but I get the same result as I did for those I made - which is it doesn't hold like a polygon. Am I doing something wrong?

     

    Maybe polyline isn't working for dynamic add on in 4.11.0.196. The log files shows:

    DAZ Studio : Incremented build number to 4.11.0.209

    • Update to dForce 1.1.0.77; fixes an issue that prevented polylines from being used as Dynamic Surface Add-On

     

  • RGcincyRGcincy Posts: 2,805

    Thanks Mada, good to hear you are having good results.

    Thanks barbult, that could be it. Is 209 available? My DIM isn't showing a product update.

  • barbultbarbult Posts: 23,049
    RGcincy said:

    Thanks Mada, good to hear you are having good results.

    Thanks barbult, that could be it. Is 209 available? My DIM isn't showing a product update.

    No, it's private beta. I don't have it either. 

  • RGcincyRGcincy Posts: 2,805

    Ahh, OK. Guess I'll have to wait until its relased, hopefully soon.

Sign In or Register to comment.