Home Page › Forums › General Chat › Packaging Script or Something?
- This topic has 10 replies, 3 voices, and was last updated 7 years, 11 months ago by
Aftyrbyrn.
-
AuthorPosts
-
October 26, 2018 at 5:12 AM #816894
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.
October 26, 2018 at 5:22 AM #816900Anonymous
InactiveRank:
Have you looked at this addon?
"https://zonegfx.com/content-package-assist/"
October 26, 2018 at 6:11 AM #816936Yeah, 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.
October 26, 2018 at 8:18 AM #817059Well, 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.
October 26, 2018 at 3:26 PM #817411wow, 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'
October 26, 2018 at 3:32 PM #817422Follow 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.
October 26, 2018 at 3:55 PM #817446Ok. 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 } } } }October 27, 2018 at 7:20 AM #818252Just 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 } } } }  October 27, 2018 at 7:24 AM #818254Thanks @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 🙂
October 27, 2018 at 7:39 AM #818269NP 🙂 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.
October 27, 2018 at 7:51 AM #818280I can't wait to own a house again...
-
AuthorPosts
- You must be logged in to reply to this topic.

