Digital Art Zone

 
     
Scripting - Basic File IO
Posted: 20 February 2013 11:09 AM   [ Ignore ]
Member
Avatar
Rank
Total Posts:  40
Joined  2006-09-17

I can’t seem to find anything on this in the WIKI.

I need to know how to use basic file in/out functions.

So for example currently I would like to use anything that does this :

1) Check if a file or directory exists.
2) Create a directory/folder.
3) Overwrite existing files without showing the ‘Are you sure ?’ type dialog when rendering the scene from script.

If someone could help me with those and point me at some docs if there are any that would be great smile

Cheers smile

Profile
 
 
Posted: 20 February 2013 01:05 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  15742
Joined  2003-10-09

What sort of files - native content files, or general files? DzContentManager will handle the former, DzFileInfo and DzDir handle things like checking for existence and getting directory listings, DzFile handles I/O for non-native files. Have a look at those classes in the DS3 docs to start with.

 Signature 

DAZ Studio Frequently Asked Questions

Index of free DAZ Studio scripts and plugins list

Profile
 
 
Posted: 22 February 2013 12:48 PM   [ Ignore ]   [ # 2 ]
Member
Avatar
Rank
Total Posts:  40
Joined  2006-09-17

HI again Richard, thanks for your attention.

At the moment I am concerned with general images files in PNG format.

I have some scripts that auto render some things for me and just need to create a couple of directories at the same time.

Sounds like DzFIle is what I need then, I will take a look.  I couldn’t find anything before, maybe I was looking in the current docs :/

Cheers smile

Profile
 
 
Posted: 22 February 2013 01:46 PM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  15742
Joined  2003-10-09

To create a directory you’d want DzDir.mkdir( name ) I think

 Signature 

DAZ Studio Frequently Asked Questions

Index of free DAZ Studio scripts and plugins list

Profile
 
 
Posted: 27 February 2013 04:33 AM   [ Ignore ]   [ # 4 ]
Active Member
Avatar
RankRank
Total Posts:  443
Joined  2007-09-01

I assume you’re talking DAZ scripting and not plugins?  Guess you noticed the big empty space under DAZ Studio> v4.x > Reference Guide > Scripting > API Reference > Object Index?

However, if you go to the DAZ Studio 3.x Documentation Centre there’s a DAZ Script API documentation zip download. All the File IO stuff is there, and the bits I’ve used so far all seem to work in DS4.5 as well. I think Rob also mentioned that there weren’t a huge number of changes between the DS3.x and DS4.x scripting (but don’t quote me on that!)...

So until the DS4 scripting documentation is online it’s probably the best place to start.

 Signature 

Website: UnrealImperfect | Freebies: Renderosity, ShareCG | ‘Art’: DeviantArt | Blog: Blogger
(aka Pete Williams)

Profile
 
 
Posted: 01 March 2013 07:22 AM   [ Ignore ]   [ # 5 ]
Member
Avatar
Rank
Total Posts:  40
Joined  2006-09-17

Thanks yes, that was what I needed.  Many thanks smile

Profile