Packaging Script or Something?

Home Page › Forums › General Chat › Packaging Script or Something?

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #816894
    Aftyrbyrn
    Participant
    Rank: Rank 4

    Is there a script or product available out there that will take a scene, or any part of it, and create a package that contains the folder structure and required files to lets say package it and post it as an installable set? I'm sure there is some script out there can gather all dependencies and copy them out. If not, then i guess i'll be learning daz scripting.... been putting that off for years.

    #816900
    Anonymous
    Inactive
    Rank: Rank-1

    Have you looked at this addon?

    "https://zonegfx.com/content-package-assist/"

    #816936
    Aftyrbyrn
    Participant
    Rank: Rank 4

    Yeah, but what i want is a way to technically create a save file that contains all dependencies, so like if i save it on my pc, copy it to my other pc, and open it, it won't bitch about missing files. I really just need to write a script that goes through every node and setting and captures the files paths of all textures, morph files and data files. Then use powershell or something to copy them out and retain the folder structure so that i can make a scene portable and non content dependent. I just wanna be able to save my characters i've created and share them, including all dependencies.

    #817059
    Errilhl
    Participant
    Rank: Rank 5

    Well, bar that it would be completely illegal (yes, I know we're on a Pirate site) to share something like that, it wouldn't be too hard to make, really - you don't really even need to have it in DAZ, you could make something that runs on the unpacked .DUF and just pulls the content from the paths in the save-file. Any programming language that can interface with the file-system and parse text-files will be able to make something like this.

    #817411
    Aftyrbyrn
    Participant
    Rank: Rank 4

    wow, i didn't even think of that. I can C# and .Net all day long, i'll see what i can come up with. And let's actually not say it's for sharing, but if i am able to see what files are used, i can identify what morph packs and figures are needed 🙂 Then list them in requirements, making it 'more legal'

    #817422
    Aftyrbyrn
    Participant
    Rank: Rank 4

    Follow up question, incase it can be answered faster than i can google, how do i unpack a DUF?

    Nevermind, it's a zip, with huge text file. easy enough. I think.

    #817446
    Aftyrbyrn
    Participant
    Rank: Rank 4

    Ok. Wrote This, it'll get me going. extract your duf with unzip or whatever, it's a text file.

    #Gets Just the library path, will have to scan all libraries when copying out
    
    $x = Get-Content 'D:\DazLibraries\_Genesis8\StartUpScene\extracted.test.duf'
    foreach($l in $x)
        {
        if($l -like "*url*")
            {
            $v=$l.Split("""")
            foreach($i in $v)
                {
                if($i -like "*/*")
                    {
                        $r = $i.Replace("%20"," ").split("#")[0]
                        $r 
                    }
                }
            }
    
        }
    #818252
    Aftyrbyrn
    Participant
    Rank: Rank 4

    Just edit the Library paths and your target path. I was able to remove all base directories, and add only the one created with the script, and open the .duf, everything required loaded. Only morphs listed were only the ones set in the character. Worked like i wanted it too 🙂 If anyone cares to play with it and improve upon it 😉 have at it.

    
    FUNCTION Create-DAZPackage
    {
    Param(
    [parameter(Mandatory=$true)]
    [String]
    $PathToDuf
    ,
    [parameter(Mandatory=$true)]
    [String]
    $PackageName
     
    )
    #EDIT THESE LINES#
    $LibraryPaths = ('E:\DazLibraryExended2', 'E:\DazLibraryExended', 'D:\DazLibraries\_Genesis8')
    
    $tgtpath = "D:\DazLibraries\_Genesis8\StartUpScene\Alice\$packageName"
    #STOP EDIT#
    $DufFile = get-content $PathToDuf
    $urls=@()
    foreach($l in $duffile)
        {
        if($l -like "*url*" -and $l -like "*/*")
            {
            $addItem = $l.Replace("%20", " ").split("#")[0].split(":")[-1].replace(""",", "").replace("""","")
            if($urls -notcontains $additem)
                {
                $urls+= $addItem
                }
            }
        }
    $finalList = $urls | Sort-Object
     
     
     
     
    foreach($item in $finalList)
        {
        foreach($path in $LibraryPaths)
            {
    
                $src = $path+$item.trim()
                if($tgt=get-item $src -ErrorAction SilentlyContinue)
                    {
                        $srcDir = $tgt.Directory.FullName
                        $targetLocation = $srcdir -replace [regex]::Escape($path), $tgtpath
                        if(get-item $targetLocation -ErrorAction SilentlyContinue){}else{New-Item -ItemType Directory $targetLocation -Force}
                        Copy-Item $tgt.FullName $targetLocation
                    }
    
            }
        }
    }
     
    #818254
    Aftyrbyrn
    Participant
    Rank: Rank 4

    Thanks @errilhl for getting my brain going, needed something to do while I was at work and a massive outage did not require my attention, but did stop all of the days plans 🙂

    #818269
    Errilhl
    Participant
    Rank: Rank 5

    NP 🙂 Glad you got it working - I'll have a look and see if I can play with it when I have time... in a couple weeks 😥 First, I need to finish renovating the damn living room: new walls, floor and ceiling, and with that, new electrics, new fireplace (that shit was HEAVY carrying up three flights of stairs) and generally just... finishing shit.

    #818280
    Aftyrbyrn
    Participant
    Rank: Rank 4

    I can't wait to own a house again...

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.

 

Post You Might Like