mcjPlanarUV - Planar UV re-mapping & heavenly displacement maps - D|S1, 2, 3, 4,5+

mCasualmCasual Posts: 4,605
edited July 2014 in Freebies

there ya go : https://sites.google.com/site/mcasualsdazscripts4/mcjplanaruv


recently i posted mcjBoxUV and mcjSphereUV

now mcjPlanarUV which projects the vertices of selected objects and figures onto a plane, and this in turn serves as the UV Map

very useful when you quickly want to give a UV map to something that doesnt have one

---

but also, in conjunction with a gray scale ramp, you can create exquisite and complex displacement/bump maps

--

see the images below

--

the version for DS3 ( and DS1, DS2 ) is ready

the version for DS 4.5+ should be ready tonight

--

i'll post the links HERE when its ready

---

1 - aiko3 was re-UV-Mapped from the point of view of a camera of her right side

2 - this black to white ramp texture was applied to the re-UVed Aiko

3 - and the anbient strength was set to 100^ white

4 - and i rendered this from the front view - it's a displacement map !

6 - and this is a 1-polygon model of Aiko3 :)

orang.jpg
1024 x 1024 - 93K
relief.jpg
1024 x 1024 - 69K
gray.jpg
1920 x 1200 - 85K
rampsmal.jpg
512 x 512 - 20K
side.jpg
1920 x 1200 - 180K
Post edited by mCasual on

Comments

  • mCasualmCasual Posts: 4,605
    edited July 2014

    1 - now these 9 objects were selected

    2 - using an upward ramp gives us this

    3 - since i forgot to zero the diffuse color the whites were over uh out of bounds

    4 - non-oversaturated version

    5 - there ! our displacement map in action

    -

    to smoothen and convert the displacement maps to 16-bit i use imagemagick which is a commandline freeware

    and a batch file like this

    i explained this in a previous post ... or even on my web site .... maybe

    c:\imagemagick\convert relief.png -depth 16 -blur 2x2 relief2.tif 
    ok.jpg
    1024 x 1024 - 341K
    dotz2.jpg
    1024 x 1024 - 111K
    ammo.jpg
    1024 x 1024 - 224K
    dotz.jpg
    1024 x 1024 - 98K
    these.jpg
    1024 x 1024 - 90K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,605
    edited July 2014

    1 - yay first multi-selection side re-UVed model in DS 4.6 !

    ( and i discovered mcjSphericalUV will need to be fixed for multi-object selections )


    2 - the resulting displacement map

    3 - the map in use !

    4 - figure processing test for DS4.6 = ok!

    5 - aiko pattern :)

    anaikoooasatexture.jpg
    800 x 800 - 323K
    anaikooo.jpg
    800 x 800 - 48K
    yay3.jpg
    800 x 800 - 216K
    yay2.jpg
    800 x 800 - 43K
    yay1.jpg
    800 x 800 - 53K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,605
    edited July 2014

    now tested on DS 1, 3, 4.5

    this group of 3 objects re-UVed in DS 1.8
    (this image rendered in DS 1.8

    projection camera was a sideview

    gnoz.jpg
    800 x 600 - 203K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,605
    edited July 2014

    the release !

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

    -----


    NOTE in related matters


    If you want to improve greatly the quality of your displacement maps,

    read this here ---> http://www.daz3d.com/forums/discussion/29672/

    ppp.jpg
    960 x 300 - 86K
    Post edited by mCasual on
  • TiZTiZ Posts: 21

    Hi there. I know that I am resurrecting a thread that has not been so much as touched since 2014, and I'm sorry for the trouble.

    I used dForm to turn a dForce skirt from a conical shape to a fully circular shape, and wanted to change its UV map accordingly so you could just use any circular shape for its texture. So I figured this would be the right tool for the job. Unfortunately, the OBJs exported from this script won't load up as UV maps. The specific error I get in the log is: "Facet count mismatch - cannot load UV Set". It happens regardless of if I export with Base mesh resolution, and it doesn't seem to be an error specific to the item I'm trying to modify, as I made it happen on another clothing item too.

    Are there any special considerations I need to keep in mind for using this script with DAZ Studio 4.20, or does it need to be updated? Am I doing something wrong?

    Thank you for your time.

  • mCasualmCasual Posts: 4,605
    edited May 2022

    Hi Tiz

    i loaded a collar figure

    i changed the camera to Top View

    i selected the root of the figure

    i ran the script

    and it created collarPlanar.obj

    then i selected the collar in the Surfaces tab

    and did a what's it called UV Set Load

    and daz studio didnt recreminate ( no mention of a wrong number of facets

    BTW  to re-UV-Map a cylinder or a cone is mcjcylindricaluv

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

    since it's dated from 2020, it must be Daz 4.5+ compatible

    -------

    now the reason for the number of facets mismatch, here's my hypothesis

    - maybe you were running the version of mcjPlanarUVs for DS 3.0 and 4.0 instead of mcjPlanarUVDS45.dsa ( probably not )

    - maybe your .obj export settings produce .obj exports that weeds out some facets

    the "triangulate N-Gons" options should not be used, this would certainly change the number of facets

    mcjPlanarUVDS45 probably doesnt modify the export settings, so you'd have to set it about like this

    File / Export / Wafefront Object (.obj)

    give a fake .obj file name

    and you are given the opportunity to change the OBJ Export Options

    here were mine for the re-UVMapping of the collar figure

    -------------

     

     

     

     

    TiZ said:

    Hi there. I know that I am resurrecting a thread that has not been so much as touched since 2014, and I'm sorry for the trouble.

    I used dForm to turn a dForce skirt from a conical shape to a fully circular shape, and wanted to change its UV map accordingly so you could just use any circular shape for its texture. So I figured this would be the right tool for the job. Unfortunately, the OBJs exported from this script won't load up as UV maps. The specific error I get in the log is: "Facet count mismatch - cannot load UV Set". It happens regardless of if I export with Base mesh resolution, and it doesn't seem to be an error specific to the item I'm trying to modify, as I made it happen on another clothing item too.

    Are there any special considerations I need to keep in mind for using this script with DAZ Studio 4.20, or does it need to be updated? Am I doing something wrong?

    Thank you for your time.

    Screenshot 2022-05-18 175743.png
    1000 x 580 - 657K
    Post edited by mCasual on
  • TiZTiZ Posts: 21

    Thank you for your quick reply, mCasual!

    Actually, a planar UV is appropriate because the original skirt *was* a cone, but my changes turned its base shape before simulation into a flat disc. So, from a not remotely circular skirt to a *definitely* full circle skirt. As such, I want to project a circular texture down onto the skirt.

    Anyways, I'm definitely using the correct version of mcjPlanarUV, for 4.5+. My export settings for OBJs is identical to yours. I even did a test export before attempting the script just to make sure, and it still didn't work. I follow those same steps you outlined to load the UV set onto the object. I've tried it with a multitude of objects and it just says the same thing every time: "The UV set loaded was invalid."

    What further information can I give you to help you figure out what's wrong? Do you want me to take a video of it happening? Should I send you the log from attempting to do it?

  • mCasualmCasual Posts: 4,605

    if you export the unmodified skirt non-subD as an .obj and use this for the load-UV Set operation, does that work?

     

  • mCasualmCasual Posts: 4,605

    if you export the unmodified skirt non-subD as an .obj and use this for the load-UV Set operation, does that work? 

     

    TiZ said:

    Thank you for your quick reply, mCasual!

    Actually, a planar UV is appropriate because the original skirt *was* a cone, but my changes turned its base shape before simulation into a flat disc. So, from a not remotely circular skirt to a *definitely* full circle skirt. As such, I want to project a circular texture down onto the skirt.

    Anyways, I'm definitely using the correct version of mcjPlanarUV, for 4.5+. My export settings for OBJs is identical to yours. I even did a test export before attempting the script just to make sure, and it still didn't work. I follow those same steps you outlined to load the UV set onto the object. I've tried it with a multitude of objects and it just says the same thing every time: "The UV set loaded was invalid."

    What further information can I give you to help you figure out what's wrong? Do you want me to take a video of it happening? Should I send you the log from attempting to do it?

  • mCasualmCasual Posts: 4,605
    edited May 2022

    i'll try it on another garment

    1 - empty scene

    2 - load the genesis 8 female basic shorts

    3 - create a camera in front of the shorts

    4 - put the shorts in "base resolution"

    5 - run mcjPlanarUV

    i open the .obj file in notepad

    and i see only vertices, no texture coordinates no facets

    so something is wrong

    i then selected all the surfaces and got the same result

    if i check the .obj of yesterday's succesfull test with the collar

    i see the VTs and the (F)acets

    Let's change the shader on the shorts to DS Default

    nope that didnt help

    Now that i have a failed specimen i'll be able to fix the script, so it's good news in a way

    symptom : the script processes the item bone by bone and isnt able to find the group of facets for those bones

    so i change the code to make it not do it bone by bone

    and it works

    i'm not sure why i made it go bone by bone with facegroups

    so i wont remove this

    i'll add a checkbox, named something like "Whole Figure Export"

    and it will treat the figure as one object, not facet groups

     

     

     

     

     

    TiZ said:

    Thank you for your quick reply, mCasual!

    Actually, a planar UV is appropriate because the original skirt *was* a cone, but my changes turned its base shape before simulation into a flat disc. So, from a not remotely circular skirt to a *definitely* full circle skirt. As such, I want to project a circular texture down onto the skirt.

    Anyways, I'm definitely using the correct version of mcjPlanarUV, for 4.5+. My export settings for OBJs is identical to yours. I even did a test export before attempting the script just to make sure, and it still didn't work. I follow those same steps you outlined to load the UV set onto the object. I've tried it with a multitude of objects and it just says the same thing every time: "The UV set loaded was invalid."

    What further information can I give you to help you figure out what's wrong? Do you want me to take a video of it happening? Should I send you the log from attempting to do it?

    shorts.jpg
    541 x 391 - 21K
    Post edited by mCasual on
  • TiZTiZ Posts: 21

    if you export the unmodified skirt non-subD as an .obj and use this for the load-UV Set operation, does that work?

    Yes, it does work.

    is the skirt a figure from the Daz Store or something modeled in blender or zbrush etc? 

    It's Sunfire's dForce Skirts Collection from Renderosity: https://www.renderosity.com/rr/mod/bcs/dforce-skirts-for-g8-female/151654

    also were some facets made invisible or deleted by the geometry editor tool?

    No, they were only moved by the dFormer that turned it from a cone to a disc.

    it's possibly preferable to do the mcjPlanarUV operation with only the skirt in the scene, in case the exporter puts them in the .obj file along with the skirt

    Right, that's how I've been doing my test cases.

    Now that i have a failed specimen i'll be able to fix the script, so it's good news in a way

    Oh good, that's a relief! I was starting to think that I was picking broken clothes for all of my test cases.

    Thank you very much for your time!

  • mCasualmCasual Posts: 4,605
    edited May 2022

    next version will have a new checkbox for problem cases

     

    shorts2.jpg
    645 x 470 - 40K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,605
    edited May 2022

    The new version with the alternative export method is online here

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

    TiZ said:

    yuki_and_the_lion_s_head_in_japan005_by_mcasual_de6gj3u (1).jpg
    1080 x 1920 - 1M
    Post edited by mCasual on
  • TiZTiZ Posts: 21

    It worked! Thank you so, so much!! <3

Sign In or Register to comment.