![]() |
#1 |
Member
Expert member
Join Date: Nov 2010
Posts: 71
|
![]()
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 |
![]() |
![]() |
![]() |
#2 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,537
|
![]()
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.
|
![]() |
![]() |
![]() |
#3 |
Member
Expert member
Join Date: Nov 2010
Posts: 71
|
![]()
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. |
![]() |
![]() |
![]() |
#4 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,537
|
![]()
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" |
![]() |
![]() |
![]() |
#5 |
Member
Expert member
Join Date: Nov 2010
Posts: 71
|
![]()
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. |
![]() |
![]() |
![]() |
#6 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,537
|
![]()
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. |
![]() |
![]() |
![]() |
#7 |
Member
Expert member
Join Date: Nov 2010
Posts: 71
|
![]()
Perfect. I will try this out as soon as possible... thanks!
|
![]() |
![]() |
![]() |
#8 | |
Member
Expert member
Join Date: Nov 2010
Posts: 71
|
![]() Quote:
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. |
|
![]() |
![]() |
![]() |
#9 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,537
|
![]()
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. |
![]() |
![]() |
![]() |
#10 |
Member
Expert member
Join Date: Nov 2010
Posts: 71
|
![]()
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? |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|