Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Script commands to import files into layer?

  1. #1
    Join Date
    May 2006
    Posts
    7

    Script commands to import files into layer?

    I'm really enjoying the new scripting feature in Artrage and I hope to see it continually expand. With the added functionality, I've decided to put some time into seeing if I could write scripts to do some automation to save time. I went through the advanced scripting document but I wasn't able to find some functionality I require and hopefully I can get some answers here.

    1) Is there any way to get the current working directory or the directory of the script being executed? For now I just prompt the user with an input box so the directory can can entered manually.

    2) I'd like to iterate through all files in a directory and import each image into a new layer. I tried recording a script and importing images to a layer manually to see the command. But the import command takes the actual binary data of the image being imported instead of a file path. Is there a way to do this and specify a file path instead?

    Thanks and great work!

  2. #2
    Join Date
    Mar 2006
    Location
    Ambient Design
    Posts
    3,936
    ArtRage scripting language has some useful functions for reading and writing files.
    http://www.artrage.com/advanced-scripting.html

    Check out the section on File Variables, and File Variable Functions in the scripting manual.
    AndyRage's mantra for graphics engine code:
    "Sure - how hard can it be?"

  3. #3
    Join Date
    Feb 2010
    Location
    Nevada
    Posts
    139
    Quote Originally Posted by AndyRage View Post
    ArtRage scripting language has some useful functions for reading and writing files.
    http://www.artrage.com/advanced-scripting.html

    Check out the section on File Variables, and File Variable Functions in the scripting manual.
    Good lord! If we have to write our own image decoder, I quit!
    Cat Boxes, a web comic

  4. #4
    Join Date
    Mar 2006
    Location
    Ambient Design
    Posts
    3,936
    I can see you're going to ask me to expose my CImage and ImageIO classes in the scripting language...

    Really though, if you're wanting that level of control, you probably want to be writing a compatible Filter Plugin.

    The scripting language isn't really intended to be a full development environment - its original intent was just simple flow control of recorded elements.

    But, if there's a demand for it, I'm sure I can fit it into the language.
    AndyRage's mantra for graphics engine code:
    "Sure - how hard can it be?"

  5. #5
    Join Date
    Jun 2011
    Location
    Hamburg Germany
    Posts
    472
    Quote Originally Posted by AndyRage View Post
    ...if there's a demand for it, I'm sure I can fit it into the language...
    Script coders hate functions which are not exposed much more than these which are.

    Unfortunately there are only fewest (but very talented) scripters in the artists community, so not sure about massive demand for it. Anyway, I vote for maximum functionality available for these few, who might make a good use of it

  6. #6
    Join Date
    Feb 2010
    Location
    Nevada
    Posts
    139
    Quote Originally Posted by AndyRage View Post
    I can see you're going to ask me to expose my CImage and ImageIO classes....
    No, no, let's keep this forum family-friendly.

    I think _spike_ is asking for a function such as ImportLayer("filename"), that would convert an image file into an ArtRage layer. I'd like that too. Super useful for automating certain tasks (i.e. importing image files into layers).

    And a corresponding ExportLayer("filename", "file format"), of course.
    Cat Boxes, a web comic

  7. #7
    Join Date
    Mar 2006
    Location
    Ambient Design
    Posts
    3,936
    Ah - I see what you're asking. Being able to specify a path and filename for import to layer/tracing/document/whatever would definitely be useful for batch processing.

    I'll add it to the script language wish-list.
    AndyRage's mantra for graphics engine code:
    "Sure - how hard can it be?"

  8. #8
    Join Date
    May 2006
    Posts
    7
    Yes, that's exactly what I was thinking about. I would definitely make good use of this new addition.

  9. #9
    Join Date
    Feb 2010
    Location
    Nevada
    Posts
    139
    Quote Originally Posted by AndyRage View Post
    Really though, if you're wanting that level of control, you probably want to be writing a compatible Filter Plugin.
    Wait, what, we can write our own Filters? How would we do that?

    I've come to the conclusion that some tasks are just too onerous for scripting (finding and erasing all white pixels, for example).
    Cat Boxes, a web comic

  10. #10
    Join Date
    Mar 2006
    Location
    Ambient Design
    Posts
    3,936
    Absolutely. ArtRage Studio Pro supports Photoshop filter plugins.

    That's definitely the prefered way to do more complex image manipulation tasks. You can get access to image maps and selection maps through the filter interface.
    AndyRage's mantra for graphics engine code:
    "Sure - how hard can it be?"

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •