Jump to content
3D Coat Forums
Bonzo

Angelscript: selecting entrys from a dropdown menu

Recommended Posts

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

Share this post


Link to post
Share on other sites

A few days ago I asked Andrew about some means of improved access to UV sets as well as about a few other scripting things and he said that we can expect them in the nearest build.

Edited by ajz3d

Share this post


Link to post
Share on other sites

Well i guess its not just selecting the UV sets then, but selecting anything from a dropdown menu. For example selecting the subdivision level when importing a file seems to be also impossible.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×