Face to Face Object Snapping

free scripts, plugins, models, textures
User avatar
trueBlue
Captain
Posts: 5216
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Face to Face Object Snapping

Post by trueBlue »

Thank you for the explanation.
What I was referring to, is selecting small triangles.
The dots/squares become larger then the triangle edge's highlight
SmalltriangleSelection.png
SmalltriangleSelection.png (48.03 KiB) Viewed 2389 times
User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Face to Face Object Snapping

Post by clintonman »

trueBlue wrote: 16 Oct 2020, 15:01 Thank you for the explanation.
What I was referring to, is selecting small triangles.
The dots/squares become larger then the triangle edge's highlight
SmalltriangleSelection.png
Yeah, I'm aware of that. I might add a dot size control or auto sizing or something. Right now it's not even clear how big a size value is. Now the size is something like 9 or 10. 9 or 10 what's? It's not meters and it doesn't seem to be pixels. It'll take a little time to figure out because of the dev cycle:
close tS
make a change to the plugin code
compile the plugin code
start truespace
test it and hope it doesn't crash tS
repeat until it works/figure it out
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5216
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Face to Face Object Snapping

Post by trueBlue »

Yikes!
Baby steps takes hours! :bananatyping:
Having preferences would be great...
dot size control or auto sizing, and No dot!
Thinking ahead, in case you develop other tools, like your Face to Face Snap...
If you incorporated your PickFace inside your Face to Face Snap scripts, you could have unique preferences verses global.
User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Face to Face Object Snapping

Post by clintonman »

Well, there's good news, the dot size is pixels after all. So there won't be any auto-sizing, just a size control.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Face to Face Object Snapping

Post by clintonman »

In your pm you mentioned that if you enable the copy option the inversion happens every other copy. So I tried it and finally saw what you saw. It only happens for me on the second time, not every other time.
This fixes it for me.You will need to test since we don't have the same results. I removed the unselect because it already is set to happen in the next command node.

bottom of the transform script:

Code: Select all

	var sx = sourceMatrix.GetScaleX();
	var sy = sourceMatrix.GetScaleY();
	var sz = sourceMatrix.GetScaleZ();

	sourceMatrix.SetScaleX(sx);
	sourceMatrix.SetScaleY(sy);
	sourceMatrix.SetScaleZ(sz);

	Node.Value(sourceNode, "Matrix") = sourceMatrix;

//if(!Copy) {
//Space.Unselect()		
//}
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5216
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Face to Face Object Snapping

Post by trueBlue »

Added your code

Code: Select all

if(!Copy) {
Space.Unselect()		
}
The above is for when Copy is false, to give an indication of when the tool ends and also disabling the toolbar icon commands.
The next script, Copy is true, the Source is selected, which enables the toolbar icon commands.
I also added UserInterface.OpenToolPanelViewEx2("" , "" ,"Scripts/CustomCommands/facetoface", 3, 1, 0); in this next script
.
.
.
RotationChanges.png
Cube selected is the Source shown in the Info panel
The bottom other Cube, 1 is an unmodified primitive(1st Destination)
Checked "Copy Source"
Selected the Cube's top two faces as the Source
Selected the Cube, 1 top two faces as the Destination and Snap
Selected the Cube, 2 top two faces as the Destination and Snap
repeat...

Results:
The Z rotation is different on the 3rd, 4th, 5th and 6th copies, and the rest are 0
User avatar
trueBlue
Captain
Posts: 5216
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Face to Face Object Snapping

Post by trueBlue »

Reinstalled tS761Std
Installed the tS761Std Beta UU that includes my additional Pick Face Widget, and the additional code from the previous post for the transform script
No inside out meshes!!!
No debug.log files!

Everything seems to be working as expected except what I posted in the previous post with the Rotation Z values issue. :D
Screenshot 2020-10-17 090911.png
Also added...

Code: Select all

	var rx = sourceMatrix.GetPitch()
	var ry = sourceMatrix.GetRoll()
	var rz = sourceMatrix.GetYaw()

	sourceMatrix.SetPitch(rx)
	sourceMatrix.SetRoll(ry)
	sourceMatrix.SetYaw(rz)
to see it that helped, but no cigar.

Edit: 20 minutes latter...
Made some changes to the script
debug.log created in:
C:\trueSpace761Std/debug.log
User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Face to Face Object Snapping

Post by clintonman »

Do you use Chrome or the new Edge browser? The internet at the moment is blaming them for the debug log. Seems it was showing up on their desktops. Maybe it shows in trueSpace because you spend more time in tS folders. All wild guesses.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5216
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Face to Face Object Snapping

Post by trueBlue »

clintonman wrote: 17 Oct 2020, 16:59 Do you use Chrome or the new Edge browser? The internet at the moment is blaming them for the debug log. Seems it was showing up on their desktops. Maybe it shows in trueSpace because you spend more time in tS folders. All wild guesses.
I am using Edge and do not have Chrome installed.
Microsoft Edge is based on Chromium
Been having issues with Edge, ever since the Win10 2004 update

Guessing that the debug.log was created when I had an error.
From the Rosetta.log

Code: Select all

09:31:46.206 ERR   Source object: /Scripts/CustomCommands/RectSelect/RMB Error: Microsoft JScript runtime error Description: 'Rectangle' is undefined Error code: 0x800a1391 - (null) Line: 5, Char: 0 Script text:  if(Rectangle) {    0x80020101  [RcScriptCmd.cpp(1170)]
Does RcScriptCmd.cpp(1170) having any meaning to you?
User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Face to Face Object Snapping

Post by clintonman »

Nope, doesn't mean anything to me.
Clinton Reese

http://clintons3d.com
Post Reply