Jump to content
3DCoat Forums

Calling external app via Angelscript


 Share

Recommended Posts

  • Advanced Member
155

Hi,

 

I'm trying to build an auto-exporter and processor, so that I hit a hotkey, and one or more textures are automatically exported to a known location. This I have working thanks to the examples, which is great.

 

I cannot for the life of me figure out how to call an external command however. All I need is to call a command with arbitrary (or even a single!) command line arguments. This is Linux btw though it would be nice if it worked for all platforms, the command line tool(s) are cross platform and have the same interface.

 

I've attempted to look at the main Angelscript docs, but I can't see anything there that will do it.

 

I'm currently having to use 4.1.17D because of the bug in later versions that prevents the Spline Tool from working with Spacing turned on. I've reported that in Mantis fwiw.

 

Any ideas anyone?

Cheers,

 

Peter B

167
Edited by pbowmar
Link to comment
Share on other sites

  • Advanced Member

So, lots of googling turns up nothing :( Anyone have any ideas?

 

Also, I can't even get what is documented to work. For example, I want to iterate each UV layer and explicitly save the Diffuse and Displace maps. This works:

    int numUvSets = GetUVSetsCount();
    for(int i =0; i<numUvSets;i++)
    {
      print(GetUVSetName(i)+ "\n");
    }

however nothing I do will let me set the UV layer in the dialog and continue:

    SetFileForFileDialogs("/tmp/testExport.png"); // this works
    cmd("$SAVETEX");/*Diffuse Map*/ // this works in that it then pops up the dialog to save the UVset
// no idea what to put here to set the UV layer to save
    cmd("$DialogButton#1");/*Ok*/ this does NOT work even to accept whatever the dialog offers

Any help or ideas most appreciated!

 

Cheers,

 

Peter B

Link to comment
Share on other sites

  • Contributor

So, lots of googling turns up nothing :( Anyone have any ideas?

I couldn't find anything on that either.

 

Also, I can't even get what is documented to work. For example, I want to iterate each UV layer and explicitly save the Diffuse and Displace maps. This works:

    int numUvSets = GetUVSetsCount();
    for(int i =0; i<numUvSets;i++)
    {
      print(GetUVSetName(i)+ "\n");
    }
however nothing I do will let me set the UV layer in the dialog and continue:

    SetFileForFileDialogs("/tmp/testExport.png"); // this works
    cmd("$SAVETEX");/*Diffuse Map*/ // this works in that it then pops up the dialog to save the UVset
// no idea what to put here to set the UV layer to save
    cmd("$DialogButton#1");/*Ok*/ this does NOT work even to accept whatever the dialog offers

SetFileForFileDialogs("/tmp/testExport.png");
cmd("$SAVETEX");
These two lines alone should be enough to make it work. At least they do work on my 3DC instance (4.5.10). Of course, a yes/no "Fill in empty parts of texture" system dialog will then follow the suppressed save dialog, and it cannot be skipped (not on Windows anyway).

Remember to "turn off" SetFileForFileDialogs with:

SetFileForFileDialogs("");

cmd("$DialogButton#1");
For standard 3DC dialogs use this instead:

void PressInNextModalDialogs(int ButtonIndex);
And to clear it:

void PressInNextModalDialogs(-1);
Edited by ajz3d
  • Thanks 1
Link to comment
Share on other sites

  • Advanced Member
257

Thanks ajz3d, unfortunately void PressInNextModalDialogs(int ButtonIndex); does nothing for me :(

 

and I still can't figure out how to modify the Combobox. I'll email support directly I guess, I'll post what I find out here.

 

BTW, the "Fill Empty parts of Texture" is solvable, there is a Pref to Always Fill, so at least that one I don't get :)

Cheers,

Peter B
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...