![]() |
#1 |
Junior Member
Member
Join Date: Jan 2018
Posts: 24
|
![]()
Hi,
I'm just starting with scripts. I've managed to select things by name, rotate, export and so on. I'm now trying to use the knife and I see a syntax I can't follow where the command is followed by "user command". How does this work please? I tried selecting the object to use as a knife and then did "ac3d ddhknife" but that didn't work. Also I'm struggling to work with internal object_id's. How can I obtain them? I don't see anything in the .AC file that looks like an object_id and I can't seem to list them. If I make something, say "new_cube" it doesn't return a value as an object_id. Finally I'd rather find out the answers to these things myself than impose on others, though Andy has been very kind and helpful, so is there more documentation anywhere? I have a list of all the AC3D commands and the arguments they take but nothing more than that. Phil |
![]() |
![]() |
![]() |
#2 |
Junior Member
Member
Join Date: Jan 2018
Posts: 24
|
![]()
UPDATE: I discovered that ddhknife was actually working. I presumed it hadn't because after I'd run the script I opened the dialogue box expecting it to show the knife object I'd set it to, but the dialogue was blank. However I run the ddhknife_go function and all was well.
However... it doesn't cut meshes very well. I tried to cut a mesh with a block and got this. zoomed in.. What I have found works well instead is boolean knife and cut away, however I can't work out how to run that with a script. I've tried knife-and-cut-away, knife_and_cut_away, knife+cut-away etc etc. Anyone? |
![]() |
![]() |
![]() |
#3 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,541
|
![]()
doing an "ac3d list" command via a telnet window gives the list of commands and one is:
boolean <subtract, union or intersect> "perform a boolean operation" In a script, you'll need to select one object e.g. objectA, then another e.g. objectB and then submit the command "ac3d boolean subtract" which should perform objectA-objectB. To find out more about how the internal commands are used, have a look in the tcl files (in the tcl subdirectory). If you look in the hierarchy tcl file, you'll see commands that work with object ids. If you are a coder, it's relatively easy to add extra commands via a plugin. There are currently no commands to construct a object (e.g. create-object, add-vertex, add-surface etc.) but they could be added. They could be rather dangerous ![]() |
![]() |
![]() |
![]() |
#4 |
Junior Member
Member
Join Date: Jan 2018
Posts: 24
|
![]()
Thanks Andy. boolean subtract doesn't work on a mesh, it says it only works on 3d objects, so what I need is boolean "knife-and-cut-away" but I can't work out what argument to use as "knife-and-cut-away" isn't recognised.
I've done the ac3d list but I only get this line: boolean <subtract, union or intersect> "perform a boolean operation" Does that mean boolean knife-and-cut-away isn't a scripted option? If it is an option can I find out what arguments are accepted? |
![]() |
![]() |
![]() |
#5 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,541
|
![]()
Have a look in tcl/ac3dmenu.tcl - you'll see all the commands attached to the menu items.
|
![]() |
![]() |
![]() |
#6 |
Junior Member
Member
Join Date: Jan 2018
Posts: 24
|
![]()
Fantastic ! This is great documentation. For anyone else its "knifecut" as per
$menubar.object.menu add cascade -label "Boolean" -menu $menubar.object.menu.boolean menu $menubar.object.menu.boolean -tearoff 0 $menubar.object.menu.boolean add command -label "Subtract" -command "ac3d boolean subtract" $menubar.object.menu.boolean add command -label "Intersect" -command "ac3d boolean intersect" $menubar.object.menu.boolean add command -label "Union" -command "ac3d boolean union" $menubar.object.menu.boolean add command -label "Cut Away" -command "ac3d boolean cut" $menubar.object.menu.boolean add separator $menubar.object.menu.boolean add command -label "Knife" -command "ac3d boolean knife" $menubar.object.menu.boolean add command -label "Knife and Cut Away" -command "ac3d boolean knifecut" |
![]() |
![]() |
![]() |
#7 |
Junior Member
Member
Join Date: Jan 2018
Posts: 24
|
![]()
Andy,
I'm back again. Not becoming a nuisance I hope ![]() I managed to use boolean knife and cut away to take some mesh out of the larger mesh. Now I'm trying to apply a texture to it. I've loaded the texture using "search_and_set_texture <object> <texturepath> <texturename>" fine, but when I try to adjust the mapping of the object to the texture it doesn't behave as normal. I get this cross bottom left I can't adjust. Any ideas? ![]() Now that isn't really a scripting question but the follow on is. I've worked out I can do Texture ReMap Top to bring it back to life, but I can't work out the TCL for that. I've found that "remap_textures <int window>" with a 0 does a remap "front" but can't work out what argument relates to remap top, if indeed I'm understanding this correctly. Is there a similar file to the tclmenu file that reveals what TCL related to buttons in the texture panel i.e. these? ![]() Thanks Phil |
![]() |
![]() |
![]() |
#8 |
Junior Member
Member
Join Date: Jan 2018
Posts: 24
|
![]()
OK, I found it. ac3duvedit.tcl
In it I found a bunch more AC3D commands that look very useful such as: ac3d uv_remap 0 "map selected surfaces from front" ac3d uv_snap_to_side top "move the selection to the top side" ac3d uv_move_to $prefs_uv_move_x $prefs_uv_move_y "move (center of) selection to this point" What I'm finding though is that AC3D is a little unreliable with these. I;ve had it crashing or beeping that it doesn't recognise the command. Sometimes it succeeds only after I've stopped TCL execution and started a secondary TCL script. Any advice? |
![]() |
![]() |
![]() |
#9 |
Junior Member
Member
Join Date: Jan 2018
Posts: 24
|
![]()
All is well if I launch the texture editor before I do these commands
|
![]() |
![]() |
![]() |
#10 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,541
|
![]()
Yes that's it. When you start the TCE, those commands are added.
The only thing I can think of is for you to call menu_uveditor from your script, which will pop up the TCE and add those commands. |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|