Go Back   AC3D Forums > General > AC3D Suggestions
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 14th December 2021, 12:13 PM   #1
Tomkat
Member
Expert member
 
Join Date: Nov 2010
Posts: 79
Default Macro Recorder?

I swear I've seen this question somewhere in these forums, but I can't find it.

Is there a way to "record" repetitive actions to a script, assign it to a menu/button/tool so that it can be quickly re-applied, when needed?

For example, a macro that does the following with the selected features...

(switch to Object mode)
Object -> Merge
(switch to Vertex mode)
Vertex -> Weld
(switch to Surface mode)
Surface -> Combine
Tomkat is offline   Reply With Quote
Old 14th December 2021, 04:00 PM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default Re: Macro Recorder?

There's not a way to record actions but you could put these in a script and have them activated from a button or menu item.
Andy is offline   Reply With Quote
Old 14th December 2021, 06:33 PM   #3
Tomkat
Member
Expert member
 
Join Date: Nov 2010
Posts: 79
Default Re: Macro Recorder?

I'm good with VBA (Excel,etc) but I can usually record actions then tweak the code, as needed. I wouldn't even know where to begin with .TCL
Unless there's a script out there that does something similar that I can tweak?

Last edited by Tomkat; 14th December 2021 at 06:52 PM.
Tomkat is offline   Reply With Quote
Old 15th December 2021, 10:29 AM   #4
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default Re: Macro Recorder?

Put the attached file in your scripts folder (within the AC3D program folder).


When AC3D starts, it reads that script and adds an item to the Tools menu.


The code is this:


Code:
proc tomkat_run {} {

    #(switch to Object mode)
    ac3d set_select_mode 1

    #Object -> Merge
    ac3d object_merge    

    #(switch to Vertex mode)
    ac3d set_select_mode 3

    #Vertex -> Weld
    ac3d weld_vertices

    #Surface -> Combine 
    ac3d combine_surfaces
}

 .mbar.tools.menu add command -label "Tomkat Super Combine" -command "tomkat_run"
 
 puts "Tomkat script complete"
To experiment set the console to stay around (File->settings->advanced) and put "ac3d list" in a script to see all the possible commands.
Attached Files
File Type: tcl tomkat.tcl (394 Bytes, 52 views)
Andy is offline   Reply With Quote
Old 15th December 2021, 11:28 AM   #5
Tomkat
Member
Expert member
 
Join Date: Nov 2010
Posts: 79
Default Re: Macro Recorder?

Oh wow... thanks!

I can't wait to try this out when I get home from work!

I was going to ask how one could ever figure out that vertex mode was "set_select_mode 3", but it appears you've given me a way to do that... so thanks for that also!

EDIT: I just noticed that the script doesn't seem to switch to Surface mode before combining...

Would that be as follows... (I'm guessing at the select_mode) ???

Code:
#(switch to Surface mode)
ac3d set_select_mode 2

Last edited by Tomkat; 15th December 2021 at 11:32 AM.
Tomkat is offline   Reply With Quote
Old 15th December 2021, 12:50 PM   #6
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default Re: Macro Recorder?

That will work yes.


Generally most of the functions that work on surfaces will work in Vertex mode - they look for surfaces that have all their vertices selected but there's no harm in changing mode like that.


There are clues on the parameters if you do and "ac3d list", you'll see:


set_select_mode <int select-mode-num>


which shows that the parameter is an integer. You can also search in the tcl folder and see how that command is used.
Andy is offline   Reply With Quote
Old 15th December 2021, 01:04 PM   #7
Tomkat
Member
Expert member
 
Join Date: Nov 2010
Posts: 79
Default Re: Macro Recorder?

Perfect. I will try this out as soon as possible... thanks!
Tomkat is offline   Reply With Quote
Old 17th December 2021, 07:11 PM   #8
Tomkat
Member
Expert member
 
Join Date: Nov 2010
Posts: 79
Default Re: Macro Recorder?

Quote:
Originally Posted by Andy View Post
To experiment set the console to stay around (File->settings->advanced) and put "ac3d list" in a script to see all the possible commands.
I'm afraid I can't figure out how to do what you instruct, here...

Maybe my AC3D is too old? Here is what my "Advanced" options look like...



Also... what does "Enable material name editing" do?
It seems pretty straightforward, but I can't find WHERE to edit the material names.
Tomkat is offline   Reply With Quote
Old 18th December 2021, 09:53 AM   #9
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default Re: Macro Recorder?

Tick "Show Windows Console". That will make it stay open after AC3D starts.

Then if you put an "ac3d list" command in the script, you'll get a list of commands in the console window.


Move your mouse over the name of a setting for a short description. If material names are editable, you'll get a text field on the material editor (right click on a material button to see that).

Last edited by Andy; 18th December 2021 at 09:56 AM.
Andy is offline   Reply With Quote
Old 19th December 2021, 12:20 PM   #10
Tomkat
Member
Expert member
 
Join Date: Nov 2010
Posts: 79
Default Re: Macro Recorder?

Ok, so I can now see the console window, but I'm unsure how to utilize the "ac3d list" command. Here's the results of my attempt...



I also tried placing the command earlier in the script, but it yielded nothing in the console.



Perhaps my version of AC3d is too old?
Tomkat is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 02:16 PM.


AC3D Forum
(C) Inivis Limited 2020