Auto-orient 3D object to path

Moderator: SecondMan

Fefson
Posts: 49
Joined: Tue Sep 27, 2016 3:58 am

Auto-orient 3D object to path

#1

Post by Fefson » Thu Sep 13, 2018 1:29 am

Is there an other way to do this, besides using calculations to time-offset the XYZ-offsets on the target? As soon as I apply the calculations, the comp slows down or freezes...

User avatar
ShadowMaker SdR
Fusionista
Posts: 492
Joined: Sun Sep 21, 2014 6:17 am
Been thanked: 30 times

Re: Auto-orient 3D object to path

#2

Post by ShadowMaker SdR » Thu Sep 13, 2018 1:42 am

Calculation is usually the way that I do it. It used to be pretty quick, so I don't know about your specific situation.

User avatar
SirEdric
Fusionator
Posts: 1113
Joined: Tue Aug 05, 2014 10:04 am
Been thanked: 99 times
Contact:

Re: Auto-orient 3D object to path

#3

Post by SirEdric » Thu Sep 13, 2018 5:08 am

I just gave this a quick try, and it seems to work fine without too much of a slowdown...

Code: Select all

{
	Tools = ordered() {
		Shape3D1 = Shape3D {
			CtrlWZoom = false,
			Inputs = {
				["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1, },
				["Transform3DOp.Translate.X"] = Input {
					SourceOp = "Shape3D1XOffset",
					Source = "Value",
				},
				["Transform3DOp.Translate.Y"] = Input {
					SourceOp = "Shape3D1YOffset",
					Source = "Value",
				},
				["Transform3DOp.Translate.Z"] = Input {
					SourceOp = "Shape3D1ZOffset",
					Source = "Value",
				},
				["Transform3DOp.Rotate.Y"] = Input { Value = -90, },
				["Transform3DOp.ScaleNest"] = Input { Value = 0, },
				["Transform3DOp.ScaleLock"] = Input { Value = 0, },
				["Transform3DOp.Scale.Y"] = Input { Value = 0.25, },
				["Transform3DOp.Scale.Z"] = Input { Value = 0.25, },
				["Transform3DOp.UseTarget"] = Input { Value = 1, },
				["Transform3DOp.Target.X"] = Input {
					Value = -1.22965058506976,
					Expression = "self:GetValue(\"Transform3DOp.Translate.X\",time+LookAheadTime)",
				},
				["Transform3DOp.Target.Y"] = Input {
					Value = 4.33481429851011,
					Expression = "self:GetValue(\"Transform3DOp.Translate.Y\",time+LookAheadTime)",
				},
				["Transform3DOp.Target.Z"] = Input {
					Value = -2.78437037114073,
					Expression = "self:GetValue(\"Transform3DOp.Translate.Z\",time+LookAheadTime)",
				},
				Shape = Input { Value = FuID { "SurfaceSphereInputs" }, },
				["MtlStdInputs.MaterialID"] = Input { Value = 1, },
				["SurfaceSphereInputs.ObjectID.ObjectID"] = Input { Value = 2, },
				LookAheadTime = Input { Value = 4, }
			},
			ViewInfo = OperatorInfo { Pos = { 440, 82.5 } },
			UserControls = ordered() {
				LookAheadTime = {
					LINKS_Name = "Look Ahead Time",
					LINKID_DataType = "Number",
					INPID_InputControl = "SliderControl",
					INP_Default = 1,
					INP_Integer = true,
					INP_MinScale = 1,
					INP_MaxScale = 10,
					INP_MinAllowed = 1,
					INP_MaxAllowed = 100,
					ICS_ControlPage = "3D"
				}
			}
		},
		Shape3D1XOffset = BezierSpline {
			SplineColor = { Red = 250, Green = 59, Blue = 49 },
			NameSet = true,
			KeyFrames = {
				[0] = { 0, RH = { 20.3333333333333, 0 } },
				[61] = { 4.01622296514478, LH = { 40.66870033741, 3.45694191982879 }, RH = { 82.6563074093643, 4.61195282238946 } },
				[126] = { 4.01622296514478, LH = { 104.340358590801, 3.5574433921174 }, RH = { 151.664099574089, 4.55982220680777 } },
				[203] = { 7.02396894482759, LH = { 177.335900425911, 8.31849414815245 }, RH = { 225.331099629402, 5.89756389777868 } },
				[270] = { -1.22965058506976, LH = { 247.666666666666, -1.22965058506976 } }
			}
		},
		Shape3D1YOffset = BezierSpline {
			SplineColor = { Red = 252, Green = 131, Blue = 47 },
			NameSet = true,
			KeyFrames = {
				[0] = { 0, RH = { 42, 0 } },
				[126] = { 0, LH = { 84.0083409772835, -0.589687732931261 }, RH = { 151.664099574089, 0.36040025680766 } },
				[203] = { 2.85072351440764, LH = { 177.335900425911, 1.78102057409852 }, RH = { 225.322847375176, 3.78116003349778 } },
				[270] = { 4.33481429851011, LH = { 247.666666666666, 4.33481429851011 } }
			}
		},
		Shape3D1ZOffset = BezierSpline {
			SplineColor = { Red = 254, Green = 207, Blue = 46 },
			NameSet = true,
			KeyFrames = {
				[0] = { 0, RH = { 20.3333333333333, 0 } },
				[61] = { 0, LH = { 40.6728022876036, 0.40838600757096 }, RH = { 82.6644996404648, -0.435253232608465 } },
				[126] = { -2.93323053915094, LH = { 104.335500359535, -3.06584907398504 }, RH = { 151.664099574089, -2.77612858250131 } },
				[203] = { 0.869248413716811, LH = { 177.335900425911, 0.832514162039603 }, RH = { 225.331099629402, 0.901211983358018 } },
				[270] = { -2.78437037114073, LH = { 247.666666666666, -2.78437037114073 } }
			}
		}
	},
	ActiveTool = "Shape3D1"
}

User avatar
bfloch
Fusioneer
Posts: 81
Joined: Wed Aug 06, 2014 4:25 pm
Been thanked: 1 time

Re: Auto-orient 3D object to path

#4

Post by bfloch » Tue Sep 18, 2018 7:59 pm

I noticed it gets really slow if you show the 3D path.
Disable the control in the context menu and it should be much faster.

User avatar
SirEdric
Fusionator
Posts: 1113
Joined: Tue Aug 05, 2014 10:04 am
Been thanked: 99 times
Contact:

Re: Auto-orient 3D object to path

#5

Post by SirEdric » Tue Sep 18, 2018 9:41 pm

But then, you don't see the path...:-)

User avatar
ShadowMaker SdR
Fusionista
Posts: 492
Joined: Sun Sep 21, 2014 6:17 am
Been thanked: 30 times

Re: Auto-orient 3D object to path

#6

Post by ShadowMaker SdR » Wed Sep 19, 2018 12:16 am

SirEdric wrote:
Tue Sep 18, 2018 9:41 pm
But then, you don't see the path...:-)
Nobody really sees the path, do they? It's just a false sense of security...

User avatar
SirEdric
Fusionator
Posts: 1113
Joined: Tue Aug 05, 2014 10:04 am
Been thanked: 99 times
Contact:

Re: Auto-orient 3D object to path

#7

Post by SirEdric » Wed Sep 19, 2018 1:53 am

But if they don't see the path, how would they determine their heading?
When you don't know your bearing, you might be heading into danger...:-)

User avatar
ShadowMaker SdR
Fusionista
Posts: 492
Joined: Sun Sep 21, 2014 6:17 am
Been thanked: 30 times

Re: Auto-orient 3D object to path

#8

Post by ShadowMaker SdR » Wed Sep 19, 2018 2:02 am

I was trying to be philosophical here Eric. Get with the program.

User avatar
SirEdric
Fusionator
Posts: 1113
Joined: Tue Aug 05, 2014 10:04 am
Been thanked: 99 times
Contact:

Re: Auto-orient 3D object to path

#9

Post by SirEdric » Thu Sep 20, 2018 2:38 am

ShadowMaker SdR wrote:
Wed Sep 19, 2018 2:02 am
I was trying to be philosophical here Eric
Me too, my friend, me too...:-)