Now with a D|S GUI - mcjObjGroupByProximity.exe utility to group faces in one figure just like anoth

mCasualmCasual Posts: 4,607
edited November 2014 in Freebies

you know what's a batch file

and you know what's an obj file

and you know obj file's faces must be properly grouped to become poser/daz compatible clothes

... then read on ...

https://sites.google.com/site/mcasualsdazscripts4/mcjobjgroupbyproximity


so, as an example you created a clothing item for Aiko3 and saved this as the obj file

mcjA3SpringDress4in.obj

in the folder C:\Program Files (x86)\DAZ\Studio\content\Runtime\Geometries\mCasual\

you know you have Aiko3 and all her perfect groups in the obj file

blAiko3.obj

in the folder

C:\Program Files (x86)\DAZ\Studio\content\Runtime\Geometries\DAZPeople\

you now open notepad and write this:



(the forum software is messing the format of this batch file ... so, see below for the screen copy)

you save this as a file named

GROUP_mcjA3SpringDress4Test.bat

in the same folder as mcjObjGroupByProximity.exe

you run GROUP_mcjA3SpringDress4Test.bat

and a few seconds later it's done, you now have the file mcjA3SpringDress5.obj

in the folder C:\Program Files (x86)\DAZ\Studio\content\Runtime\Geometries\mCasual\

it contains the same geometry as mcjA3SpringDress4in.obj, but the facets are grouped based on their proximity to Aiko3's groups

groupme.jpg
1121 x 163 - 113K
auto.jpg
1600 x 900 - 453K
Post edited by mCasual on

Comments

  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    Hi, so you have a script then that your offering? I'm building some clothing for a new figure that's not yet released by another company. I built it for DAZ Studio with the hopes that I can also export it as a cr2 for Poser when it's all done but I got some feedback about this very issue. This is from the email:

    Poser has rules for its grouping, in order to work with legacy figures. DS doesn't care, it treats groups as selection sets. So in Poser only child parent groups are allowed. Your left and right thigh groups touch, so Poser doesn't like that. You can force Poser into using it by added weld statements for the left and right thighs but it is easier to just have the hip/pelvis group separate them. Then you don't need those extra weld statements.

    I exported from ZBrush and the set up the UV's in the Ultimate Unwrap 3D Pro application and I guess somewhere along the way some information got lost? Not sure. I'm not technical in that way so wondering if this is something you can help with?

    Gracias!

  • mCasualmCasual Posts: 4,607
    edited November 2014

    RAMWolff said:
    Hi, so you have a script then that your offering? I'm building some clothing for a new figure that's not yet released by another company. I built it for DAZ Studio with the hopes that I can also export it as a cr2 for Poser when it's all done but I got some feedback about this very issue. This is from the email:

    Poser has rules for its grouping, in order to work with legacy figures. DS doesn't care, it treats groups as selection sets. So in Poser only child parent groups are allowed. Your left and right thigh groups touch, so Poser doesn't like that. You can force Poser into using it by added weld statements for the left and right thighs but it is easier to just have the hip/pelvis group separate them. Then you don't need those extra weld statements.

    I exported from ZBrush and the set up the UV's in the Ultimate Unwrap 3D Pro application and I guess somewhere along the way some information got lost? Not sure. I'm not technical in that way so wondering if this is something you can help with?

    Gracias!

    hi there

    it's an executable Windows (dos) utility/application

    lets say you load a figure in daz studio, make sure it's zeroed
    you export it as an obj file using the Poser scale
    the "write groups" "use existing groups" option must be On

    on the other hand if the figure was distributed with an obj file in a Runtime/Geometries folder
    it's better to use this .obj

    or if it's in obz format, you duplicate it, rename it to .zip, and unzip that file, the result is the obj file

    we'll call this the "reference object" or statue ( this can only be used as a reference you cant use it as base material nor distribute it )

    then you create your clothing around that "statue" in your modeling software

    now comes the task of grouping the facets in your obj, similarly to the way the reference figure has its facets grouped

    normally you'd spend an hour "manually" grouping facets, using the reference "statue" as a guide

    but mcjObjGroupByProximity.exe which will be released today can do the grouping

    so you save your clothing as an obj without changing the scale

    ( you could verify this by re-importing the "statue" and your saved obj clothing item to see if they still fit

    you write a Windows/DOS batch file using notepad

    this batch file will Run mcjObjGroupByProximity.exe, and supply it with the path to

    - the reference object
    - the clothing object
    - the output object which contains the geometry and textures of your clothing obj, but with groupings similar to the reference object

    this new obj file is now compatible with CR2s like the reference figure's cr2

    ----------

    the hip/buttocks area is tricky

    ideally the facets owned by the "hip" group form a barrier between the lButtock and the rButtock
    and the hip group forms a barrier between the buttocks and the abdomen group
    the hip group shape is like shorts

    this matches with the way the figure skeletons are built:

    so it's better to tweak your groupings to behave like that

    wazaa.jpg
    1600 x 900 - 339K
    jumper.jpg
    800 x 450 - 84K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited November 2014

    ah i wondered why the groups looked so clean, it's because i was showing you hand-made groups

    the automatic "by-proximity" groups and in fact Aiko's groups are more jagged

    but when there's many facets it doesnt look bad ! dont worry

    -----

    as we speak i'm finishing the instruction manual / release page

    https://sites.google.com/site/mcasualsdazscripts4/mcjobjgroupbyproximity

    i just have to make a fake shirt so the SL_Woman's sideboobs are less uhh evident

    liltop.jpg
    1920 x 1080 - 474K
    slmats960.jpg
    960 x 540 - 112K
    proxim.jpg
    1920 x 1080 - 475K
    wazaa960.jpg
    960 x 540 - 171K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited December 1969

    it's readyyyyyyyyyyyyy

    there's even a pdf manual

    https://sites.google.com/site/mcasualsdazscripts4/mcjobjgroupbyproximity

    bodycon.jpg
    1920 x 1080 - 465K
  • RAMWolffRAMWolff Posts: 10,212
    edited November 2014

    Thanks so much. I really appreciate the time you took for this. I see now what was meant by grouping. I did my own grouping in ZBrush for a new fellow that's not yet on the market but I guess I have to follow HIS grouping and not my own then in order for Poser to make proper use of the clothing then. That's really weird to me. This new figure is similar to Genesis in that it's weight mapped and the grouping it allot cleaner (no weird jaggy zones) than Gen 3 or 4 DAZ figures.

    Post edited by RAMWolff on
  • stronghandsstronghands Posts: 104
    edited December 1969

    Thank you! This is a very useful tool, and I'm sure it will get plenty of use from me.

  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    Is there anyway you can write a interface for this? I don't use DOS as the command prompt is a bit tricky for me to use.

  • mCasualmCasual Posts: 4,607
    edited November 2014

    RAMWolff said:
    Is there anyway you can write a interface for this? I don't use DOS as the command prompt is a bit tricky for me to use.

    it will be like that ( code borrowed from mcjTeleBlender and mcjEtherCam which by the way has a FFMpeg UI )

    with a text area that lets you know if mcjObjGroupByProximity.exe was able to perform the task or not

    ( for example, if you specified an output folder for which you don't have write-operation administrative privileges )

    here's what a succesful session looks like in the console window

    mcjObjGroupByProximity.exe Launched
    stderr: 
    reading C:/Program Files (x86)/DAZ/Studio/content/Runtime/Geometries/DAZPeople/blAiko3.obj
    numgroups: 55
    g chest
    g neck
    g rCollar
    g abdomen
    g hip
    g rShin
    g rThigh
    g rButtock
    g rFoot
    g rToe
    g rShldr
    g rForeArm
    g rHand
    ...
    ...
    g head
    ..
    numvertices : 72712
    numfaces : 74510
    reading C:/Program Files (x86)/DAZ/Studio/content/Runtime/Geometries/mCasual/mcjA3SpringDress4in.obj
    numgroups: 0
    numvertices : 6405
    numfaces : 6353
    mcjObjGroupByProximity.exe Exited


    when the "create .bat only" button is used, the console message reads


    the batch file
    mcjA3SpringDress5b.bat
    was created in the folder
    C:/Program Files (x86)/DAZ/Studio/content/Runtime/Geometries/mcasual
    It contains this:
    "C:/Program Files/mCasual/mcjObjGroupByProximity/mcjObjGroupByProximity.exe" "C:/Program Files (x86)/DAZ/Studio/content/Runtime/Geometries/DAZPeople/blAiko3.obj" "C:/Program Files (x86)/DAZ/Studio/content/Runtime/Geometries/mCasual/mcjA3SpringDress4in.obj" "C:/Program Files (x86)/DAZ/Studio/content/Runtime/Geometries/mcasual/mcjA3SpringDress5b.obj"


    uiui46.jpg
    740 x 422 - 104K
    somehelp.jpg
    489 x 429 - 113K
    UI2.jpg
    646 x 371 - 83K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited November 2014

    it's almost ready !

    now testing it in Daz Studio 1.8 and 2.3

    which was very useful since there were some bugs i didn't trigger in DS3 and DS 4.6

    ---

    in the image below i created a DS 1.8 primitive cylinder, 32x32

    placed it around Aiko3

    made her invisible

    exported the cylinder as an obj with Poser scale

    and ran the grouping process

    then i manually changed the g statements to usemtl in the resulting object file
    so i could display the groups as colors ... for show-off purposes :)

    only got to test it in DS 2.3, then make the icon/thumbnail, then package it and upload it

    if you're in a hurry, it will be ... here https://sites.google.com/site/mcasualsdazscripts4/mcjobjgroupbyproximityui

    showGroupings.jpg
    1280 x 958 - 559K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited November 2014

    Ready !!!

    so, over here you have the standalone Windows-executable utility that does the hard work of grouping

    https://sites.google.com/site/mcasualsdazscripts4/mcjobjgroupbyproximity

    and over here you have the front end for Daz Studio 1, 2, 3, 4 to simplify the task

    of supplying the paths to your 3 obj files to that utility

    https://sites.google.com/site/mcasualsdazscripts4/mcjobjgroupbyproximityui

    demoa.jpg
    455 x 455 - 116K
    Post edited by mCasual on
  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    Thank you, thank you, thank you so much! WOOT!! :-)

  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    What all do I need from the FIRST link? Just the zip or do I need the mcjObjGroupByProximity.cpp file too?

  • mCasualmCasual Posts: 4,607
    edited November 2014

    RAMWolff said:
    What all do I need from the FIRST link? Just the zip or do I need the mcjObjGroupByProximity.cpp file too?

    the .cpp is the source code, the program listing in human-readable format
    it's for programmers that could want to make custom versions

    make a version that runs on a Mac, Linux for example

    Post edited by mCasual on
  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    Ah, so just the zip and the pdf. Thanks Casual!

  • stronghandsstronghands Posts: 104
    edited December 1969

    Thanks!!! I think I'm in heaven....

Sign In or Register to comment.