Script to get around geograft issues

DAZ Studio Integrated Plugin (Integrated Plugin maintained by OTOY)

Moderator: BK

Forum rules
Please keep character renders sensibly modest, please do not post sexually explicit scenes of characters.
User avatar
DrHemulen
Licensed Customer
Posts: 317
Joined: Thu Dec 26, 2013 7:09 pm

I've been fumbling with a script to "fix" geografting issues, where you can't apply you templated materials without the material assignment going crazye. It seems to work now, so I thought I would share. It's a Linux script, so your mileage may vary.
I'm running it on windows, using cygwin, which is a very simple way to get Linux bash scripting on windows.

The idea is as follows:
Create a target model with the geo graft in place. This model must have autogenerated materials from octane. The materials don't matter, you can keep them as white defaults if you want to. Save this as a scene subset, name it target or similar, as this will be the target model for your materials.

Now set up the materials like you want them on two models:
Host figure: Host without geograft in place, with your custom materials. Save this as a scene subset, name it source1 or similar
Graft: This is just the geograft model, with your custom materials. Save this as a scene subset, name it source2 or similar

Run the script. Syntax is
./convert -s1 source1.duf -s2 source2.duf -t target.duf

This will write a new .duf called target_convereted.duf or similar. It will move the materials from the source models to the target model:

Image

Limitations:
You still can't drag and drop materials into your new model. It's locked with the materials you assigned to your sources. You can still change things like settings and images though.

This is very much a test alpha thing, so let me know how wrong it goes. I'll implement some more error checking later.

Download here, OctaGraft 0.21:
https://drive.google.com/file/d/0B2Dqt4 ... sp=sharing
Last edited by DrHemulen on Tue Dec 30, 2014 8:03 pm, edited 3 times in total.
GTX 780, 6 gigs of VRAM - Win 7 Home Premium 64 bits
User avatar
larsmidnatt
Licensed Customer
Posts: 499
Joined: Tue Sep 25, 2012 12:28 pm

thanks for sharing this, i couldnt get it to work though.

after some trial and error with Cygwin I figured my command had to look like this

Code: Select all

$ /cygdrive/c/Users/me/Desktop/convert -s1 /cygdrive/p/source1.duf -s2 /cygdrive/p/source2.duf -t /cydrive/p/target.duf
Which got the script to run. (my files were put on the p drive so they were easy to find)
but as it tries to run i get a lot of errors here is the first part

source files: /cygdrive/p/source1.duf /cygdrive/p/source2.duf
target file: /cydrive/p/target.duf
output file: /cydrive/p/target_converted.duf
---------------
grep: /cydrive/p/target.duf: No such file or directory
grep: /cydrive/p/target.duf: No such file or directory
grep: /cydrive/p/target.duf: No such file or directory
Materials in source: 28
materials in secondary source: 1
cp: cannot stat ‘/cydrive/p/target.duf’: No such file or directory
Total source materials : 29
grep: /cydrive/p/target.duf: No such file or directory
Target materials :
---------------
processing matrial 1 ID From: "Legs" to: Target line:
sed: can't read /cydrive/p/target_converted.duf: No such file or directory
Win10 x64
i9 10900k 64GB
2080S 8GB
DS 4.15 OcDS Prime ^_^
User avatar
DrHemulen
Licensed Customer
Posts: 317
Joined: Thu Dec 26, 2013 7:09 pm

The scrpit can't find your target duf.
I always put the .duf files in the same dir as the script, that way you avoid all the crazy paths :)
GTX 780, 6 gigs of VRAM - Win 7 Home Premium 64 bits
User avatar
larsmidnatt
Licensed Customer
Posts: 499
Joined: Tue Sep 25, 2012 12:28 pm

DrHemulen wrote:The scrpit can't find your target duf.
I always put the .duf files in the same dir as the script, that way you avoid all the crazy paths :)
doh, that makes sense... I'll try that later. thanks
Win10 x64
i9 10900k 64GB
2080S 8GB
DS 4.15 OcDS Prime ^_^
User avatar
larsmidnatt
Licensed Customer
Posts: 499
Joined: Tue Sep 25, 2012 12:28 pm

i got it to work. still had to do some crazy paths though so it could find the files cause you still need to direct it to the folder for each part of the command. but I did get it to work thanks much.

this fixed myissue where G2F would end up with messed up material zones after you added the geo-graft. I wont need to spot render to get around this issue anymore it seems!
Win10 x64
i9 10900k 64GB
2080S 8GB
DS 4.15 OcDS Prime ^_^
User avatar
DrHemulen
Licensed Customer
Posts: 317
Joined: Thu Dec 26, 2013 7:09 pm

Great :) Odd with the paths, I just dump the files in the script folder and run it?!
Are you using this for 1.2? I thought it worked now in 2.1, I tested it briefly, and drag/dropping on geografted models didn't seem to mess up everything :)
GTX 780, 6 gigs of VRAM - Win 7 Home Premium 64 bits
User avatar
larsmidnatt
Licensed Customer
Posts: 499
Joined: Tue Sep 25, 2012 12:28 pm

DrHemulen wrote:Great :) Odd with the paths, I just dump the files in the script folder and run it?!
Are you using this for 1.2? I thought it worked now in 2.1, I tested it briefly, and drag/dropping on geografted models didn't seem to mess up everything :)
regarding the paths it's probably how Cygwin works. not a biggie but yeah even with the files in the same folder as the script, it can't find them.

I'm in 2.1 and geografted models certainly mess up everything if you are using G2F. It didn't cause any issues when I tried the same on Genesis 1 (at least not with the male bits).
Win10 x64
i9 10900k 64GB
2080S 8GB
DS 4.15 OcDS Prime ^_^
User avatar
DrHemulen
Licensed Customer
Posts: 317
Joined: Thu Dec 26, 2013 7:09 pm

Ok, weird, it worked for me on G2F when I tried it earlier (with G2F genitalia), also with one of my own geografts. All test it later tonight again.
Still if the script works, the problem should be relatively simple to fix (I think) as it's just shuffeling the Octane material strings around in the duf files.
GTX 780, 6 gigs of VRAM - Win 7 Home Premium 64 bits
User avatar
larsmidnatt
Licensed Customer
Posts: 499
Joined: Tue Sep 25, 2012 12:28 pm

Yeah it certainly doesn't work for me for G2F (by default) and I know some other folks in the forum. Whatever dark magic you are using is working however so I'm happy about that. Glad I gave it a shot.
Win10 x64
i9 10900k 64GB
2080S 8GB
DS 4.15 OcDS Prime ^_^
User avatar
DrHemulen
Licensed Customer
Posts: 317
Joined: Thu Dec 26, 2013 7:09 pm

Awesome, it's not always these scripts you make for yourself ever works for anybody else :)

Download here, OctaGraft 0.21:
https://drive.google.com/file/d/0B2Dqt4 ... sp=sharing

A few minor bug fixes, cleanup and clearer output, so it should be clearer to see what's going on.

ANd yeah, I also have the issues. When I tested first, I was dragging and dropping on the graft. Doing it on the host model messes things up as pr. 1.2.

Important things:
The target file MUST have autogenerated materials. Otherwise there will be not material info in the file to overwrite
The script will generate (and overwrite) and output file with the suffix _converted.duf
The script is tested with a very limited selection of grafts. If something goes weird, check the number of materials (should be the same number for source1+source2 and target), and check that the material names are the same for each material.
Last edited by DrHemulen on Mon Dec 29, 2014 7:46 pm, edited 1 time in total.
GTX 780, 6 gigs of VRAM - Win 7 Home Premium 64 bits
Post Reply

Return to “DAZ Studio”