Jump to content
3DCoat Forums

Angelscript: selecting entrys from a dropdown menu


Bonzo
 Share

Recommended Posts

  • New Member

Hi there,

 

I'm currently writing a script to import multiple textures and assign it to the respective UV set. In order to do so I set a modal dialog callback function before i call cmd("$LOADTEX");.

The callback function trys to select a UV set with cmd($#Uvsetname); and then presses the ok button. But unfortunatly it does only work the first time i call that function and sometimes not even then. Pressing the ok button works every time.

 

It feels a bit strange having to select the UV set by its name, but I cant figure out how to get the name or ID of the dropdown menu directly.

 

Has anybody some advice?

 

Thanks in advance,

David

Link to comment
Share on other sites

  • 1 year later...
  • Advanced Member

OK here are my scripts that allow for a completely dialog-free, single-hotkey export of Diffuse and Displace. Specular can be easily added too, but I don't use that at the moment.

 

I've developed and tested in 4.1.17D because I can't use 4.5 at the moment due to a bug that could be my graphics card :) However, I expect these scripts to work in 4.5 too.

 

Put them in your $HOME/3D-CoatV4/Scripts directory and add their full paths to the 'recent.txt' file so they appear int he Scripts menu in 3DC. Or just do Scripts-Run Script and I think that adds them too for you.

 

Run the setExportDir.script first, this lets you pick the directory to export to. Then whenever you want to export, you can run the exportMaps.script (I bound Hotkey F5 to it) and every UV set will be saved out automatically.

 

You may need to set the Preference Padding to Always or Never to avoid a dialog box there. I could script around it but the Pref is easier.

 

Many thanks to Andrew's kind help and patience :) and also ajz3d for his help in another thread.

 

NO WARRANTY

 

This has only been tested on Linux. It may or may not work on Windows or Mac. There are a couple of lines of code that build a path using crude concatenation of strings, which may fail on Windows especially.

 

You take full responsibility and assume all risk for downloading and running this script. If it erases your harddrive or gets your cat pregnant, it's not on me :)

 

I have very little time so if you have suggestions for enhancement or requests, I will listen but make no promises to be able to do anything more with this.

 

 


40

Cheers,

 

Peter B

60

3dcExportMapsScript.zip

Edited by pbowmar
  • Like 1
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...