mcjObjGroupByProximity



Introduction

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 ...



* NEW ** NEW ** NEW ** NEW *
There is now a User Interface for Daz Studio 1, 2, 3, 4 to simplify all this








Installing


The installation package, a zip file, is found at the bottom of the page.

it contains mcjObjGroupByProximity.exe and a text version of what you are currently reading.

Typical locations where to install it are

c:\program files\mcasual\mcjObjGroupByProximity

C:\Users\YOURUSERNAME\Documents\mcasual\mcjObjGroupByProximity

in my case it's simply

I:\aoa\prox


Use

WWWWW
Example 1
WWWWW

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:

SET MCJA="C:\Program Files (x86)\DAZ\Studio\content\Runtime\Geometries\DAZPeople\blAiko3.obj"
SET MCJB="C:\Program Files (x86)\DAZ\Studio\content\Runtime\Geometries\mCasual\mcjA3SpringDress4in.obj"
SET MCJC="C:\Program Files (x86)\DAZ\Studio\content\Runtime\Geometries\mCasual\mcjA3SpringDress5.obj"
mcjObjGroupByProximity %MCJA% %MCJB% %MCJC%
pause

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

note: in the image below, i used wordpad and "manually" ( search and replace )
assigned all the buttock-group faces to the hip group
because i wanted that dress's tight fit to remain, 
at the price of having to create D-Form/magnets to fix poke-through



Use

WWWWW
Example 2
WWWWW

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 turned 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 can do the grouping for you

From your 3d modeling software, save your clothing as an obj without changing the scale

You could verify the scale is intact by re-importing the “statue” and your saved obj clothing item and 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  ( MCJA )
- the clothing object ( MCJB )
- the desired output object ( MCJC )

SET MCJA="C:\Program Files (x86)\DAZ\Studio\content\Runtime\libraries\Character\SL Avatar\SL_Female.obj"
SET MCJB="C:\Program Files (x86)\DAZ\Studio\content\Runtime\libraries\Character\SL Avatar\old_mcjSLWomanJumper.obj"
SET MCJC="C:\Program Files (x86)\DAZ\Studio\content\Runtime\libraries\Character\SL Avatar\mcjSLWomanJumper.obj"
mcjObjGroupByProximity %MCJA% %MCJB% %MCJC%
pause

this new obj file ( mcjSLWomanJumper.obj ) is now compatible with CR2s like the reference figure’s cr2 ( SL_Female )




Use

WWWWW
notes
WWWWW

the hip/buttocks area is tricky

ideally the facets owned by the “hip” group should form a barrier between the lButtock and the rButtock groups

and the hip group should form a barrier between the buttock groups and the abdomen group

the hip group shape is like shorts

this matches with the way the Poser/Daz figure skeletons are built:

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

in the image shown below, mcjObjGroupByProximity created a bridge between the two buttock groups

you would need to bring this .obj back in your modeling software and reassign this facet to the' hip' group



License

// Copyright (c) <mCasual/Jacques>
// November 21st 2014
//
// ( The following is meant to be an "MIT License" )
//
// Permission is hereby granted, free of charge, to any persoration
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.

ċ
mCasual Jacques,
Nov 21, 2014, 5:29 PM
ċ
mCasual Jacques,
Nov 21, 2014, 5:31 PM
ċ
mcjObjGroupsByProximity.zip
(7k)
mCasual Jacques,
Nov 21, 2014, 5:27 PM
Ċ
mCasual Jacques,
Nov 21, 2014, 7:47 PM
Comments