- Posts: 163
- Joined: Tue Apr 26, 2016 12:20 pm
Hi. Today I've been trying to apply all I've learnt this week about expressions to do somethig I'd love to have at hand:
A Customized Camera Crane with hothead.
Tricky till I got the parenting/linking interactions, but after a couple of hours it works perfect. In one single control panel I have Zoom, Pan, Tilt, Crane lift angle, Crane orientation, and Crane Arm lenght (telescopic, yeah, it's free). Later Ill send there Shake/perturb controllers too.
Now, there are two important features I want to implement to finisg the set, but I've been trying and testing, fighting for hours, but I'm stucked:
- Target Camera: My current crane works perfect with free camera. Would be perfect if I could switch on the camera target and link it to any object in my scene. (In that case, rotation angles are offsets to the camera target angle. As it works with normal cameras.
- AutoFocus. With a dist3d() function I can set an expression linking focus.dist to the camera target or any other object distance to my scene. I want to have a crane cam with autofocus to target if it's a target camera, or to my "focustarget" object if I'm using a free camera in the crane.
The problem with both features is that the camera and it's target have now altered coordinates, as they are at the end of a chain of rotating and telescopic geometry.
I know I need the CoordTransform Position modifier. I've learnt how to use it to make a "world object" follow a "offseted coords" object. Nice but:
It only works if the looking at object, the one receiving the modifier, is referenced to world coordinates. But, if that object is also "offseted" becasuse he also is part of a hierarchy, then it does not work. In that case, do I need nested CoordTransform modifiers? Too much for my mind.
this is an example with a simplified scene:
CoordTransform Position working perfect, untill you offset his coordinate system.
¿Can anyone solve this and make the plane keep looking at the ball even after moving his parent merge? Is it imppossible or is just too difficult for me?
A Customized Camera Crane with hothead.
Tricky till I got the parenting/linking interactions, but after a couple of hours it works perfect. In one single control panel I have Zoom, Pan, Tilt, Crane lift angle, Crane orientation, and Crane Arm lenght (telescopic, yeah, it's free). Later Ill send there Shake/perturb controllers too.
Now, there are two important features I want to implement to finisg the set, but I've been trying and testing, fighting for hours, but I'm stucked:
- Target Camera: My current crane works perfect with free camera. Would be perfect if I could switch on the camera target and link it to any object in my scene. (In that case, rotation angles are offsets to the camera target angle. As it works with normal cameras.
- AutoFocus. With a dist3d() function I can set an expression linking focus.dist to the camera target or any other object distance to my scene. I want to have a crane cam with autofocus to target if it's a target camera, or to my "focustarget" object if I'm using a free camera in the crane.
The problem with both features is that the camera and it's target have now altered coordinates, as they are at the end of a chain of rotating and telescopic geometry.
I know I need the CoordTransform Position modifier. I've learnt how to use it to make a "world object" follow a "offseted coords" object. Nice but:
It only works if the looking at object, the one receiving the modifier, is referenced to world coordinates. But, if that object is also "offseted" becasuse he also is part of a hierarchy, then it does not work. In that case, do I need nested CoordTransform modifiers? Too much for my mind.
this is an example with a simplified scene:
CoordTransform Position working perfect, untill you offset his coordinate system.
¿Can anyone solve this and make the plane keep looking at the ball even after moving his parent merge? Is it imppossible or is just too difficult for me?
- Code: Select all
{
Tools = ordered() {
Crane = Shape3D {
NameSet = true,
Inputs = {
SceneInput = Input {
SourceOp = "LookAtMe",
Source = "Output",
},
["Transform3DOp.Translate.Y"] = Input {
Value = 1,
Expression = "SurfaceCylinderInputs.Height/2",
},
Shape = Input { Value = FuID { "SurfaceCylinderInputs" }, },
["MtlStdInputs.MaterialID"] = Input { Value = 2, },
["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 3, },
["SurfaceCylinderInputs.Radius"] = Input { Value = 0.04, },
["SurfaceCylinderInputs.ObjectID.ObjectID"] = Input { Value = 4, }
},
ViewInfo = OperatorInfo { Pos = { 1123.11, 69.6027 } },
},
LookAtMe = Shape3D {
NameSet = true,
Inputs = {
["Transform3DOp.Translate.Y"] = Input { Value = 1.019, },
Shape = Input { Value = FuID { "SurfaceSphereInputs" }, },
["MtlStdInputs.MaterialID"] = Input { Value = 1, },
["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1, },
["SurfaceSphereInputs.Radius"] = Input { Value = 0.3, },
["SurfaceSphereInputs.ObjectID.ObjectID"] = Input { Value = 2, }
},
ViewInfo = OperatorInfo {
Pos = { 1007.24, 68.6937 },
Flags = {
ShowPic = true
}
},
},
Text3D1_1_1 = Text3D {
Inputs = {
Size = Input { Value = 0.38, },
Font = Input { Value = "Open Sans", },
StyledText = Input { Value = "LOCAL MERGE\n(transformed)\n\n", },
Style = Input { Value = "Bold", },
ExtrusionProfile = Input {
SourceOp = "Text3D1_1_1ExtrusionProfile",
Source = "Value",
},
ManualFontKerningPlacement = Input {
Value = StyledText {
Array = {
},
Value = ""
},
},
},
ViewInfo = OperatorInfo { Pos = { 1302.24, 121.14 } },
},
Text3D1_1_1ExtrusionProfile = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.0666666666666667, 0.333333333333333 }, Flags = { Linear = true } },
[0.2] = { 1, LH = { 0.133333333333333, 0.666666666666667 }, RH = { 0.4, 1 }, Flags = { Linear = true } },
[0.8] = { 1, LH = { 0.6, 1 }, RH = { 0.866666666666667, 0.666666666666667 }, Flags = { Linear = true } },
[1] = { 0, LH = { 0.933333333333333, 0.333333333333333 }, Flags = { Linear = true } }
}
},
SplineColor = { Red = 192, Green = 128, Blue = 64 },
NameSet = true,
},
Merge3D1 = Merge3D {
CtrlWZoom = false,
Inputs = {
["Transform3DOp.Translate.X"] = Input { Value = -4.5288, },
["Transform3DOp.Rotate.X"] = Input {
SourceOp = "Merge3D1XRotation",
Source = "Value",
},
["Transform3DOp.Scale.X"] = Input {
SourceOp = "Merge3D1XScale",
Source = "Value",
},
SceneInput2 = Input {
SourceOp = "Text3D1_1_1",
Source = "Output",
},
SceneInput3 = Input {
SourceOp = "Crane",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { 1282, 152 } },
},
Merge3D1XRotation = BezierSpline {
SplineColor = { Red = 255, Green = 128, Blue = 128 },
NameSet = true,
KeyFrames = {
[0] = { 0, RH = { 27, 0 }, Flags = { Loop = true, Pingpong = true } },
[81] = { 22, LH = { 54, 22 }, Flags = { Loop = true, Pingpong = true } }
}
},
Merge3D1XScale = BezierSpline {
SplineColor = { Red = 251, Green = 22, Blue = 119 },
NameSet = true,
KeyFrames = {
[0] = { 0.912, RH = { 15.6666666666667, 0.912 }, Flags = { Loop = true, Pingpong = true } },
[47] = { 2.68, LH = { 31.3333333333333, 2.68 }, Flags = { Loop = true, Pingpong = true } }
}
},
WORLD = Merge3D {
NameSet = true,
Inputs = {
["Transform3DOp.Translate.X"] = Input { Expression = "0.0", },
["Transform3DOp.Translate.Y"] = Input { Expression = "0.0", },
["Transform3DOp.Translate.Z"] = Input { Expression = "0.0", },
["Transform3DOp.Rotate.X"] = Input { Expression = "0.0", },
["Transform3DOp.Rotate.Y"] = Input { Expression = "0.0", },
["Transform3DOp.Rotate.Z"] = Input { Expression = "0.0", },
["Transform3DOp.Scale.X"] = Input { Expression = "1", },
SceneInput1 = Input {
SourceOp = "NOW_MOVE_THIS",
Source = "Output",
},
SceneInput2 = Input {
SourceOp = "Merge3D1",
Source = "Output",
},
SceneInput3 = Input {
SourceOp = "Text3D1",
Source = "Output",
},
SceneInput4 = Input {
SourceOp = "PointLight1",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { 1568.79, 152.886 } },
},
Text3D1 = Text3D {
Inputs = {
Size = Input { Value = 0.26, },
Font = Input { Value = "Open Sans", },
StyledText = Input { Value = "\nworld 0,0,0", },
Style = Input { Value = "Bold", },
ExtrusionProfile = Input {
SourceOp = "Text3D1ExtrusionProfile",
Source = "Value",
},
ManualFontKerningPlacement = Input {
Value = StyledText {
Array = {
},
Value = ""
},
},
},
ViewInfo = OperatorInfo { Pos = { 1559.3, 114.855 } },
},
Text3D1ExtrusionProfile = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.0196116135138184, 0.098058067569092 }, Flags = { Linear = true } },
[0.2] = { 1, LH = { 0.180388386486182, 0.901941932430908 }, RH = { 0.3, 1 }, Flags = { Linear = true } },
[0.8] = { 1, LH = { 0.7, 1 }, RH = { 0.819611613513818, 0.901941932430908 }, Flags = { Linear = true } },
[1] = { 0, LH = { 0.980388386486182, 0.098058067569092 }, Flags = { Linear = true } }
}
},
SplineColor = { Red = 192, Green = 128, Blue = 64 },
NameSet = true,
},
PointLight1 = LightPoint {
Inputs = {
["Transform3DOp.Translate.X"] = Input { Value = -3.942, },
["Transform3DOp.Translate.Z"] = Input { Value = 4.12914104087048, },
},
ViewInfo = OperatorInfo { Pos = { 1558.67, 190.276 } },
},
NOW_MOVE_THIS = Merge3D {
NameSet = true,
Inputs = {
SceneInput1 = Input {
SourceOp = "Text3D1_1",
Source = "Output",
},
SceneInput2 = Input {
SourceOp = "autoalignplane",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { 1805.69, 150.851 } },
},
Text3D1_1 = Text3D {
Inputs = {
Size = Input { Value = 0.38, },
Font = Input { Value = "Open Sans", },
StyledText = Input { Value = "LOCAL MERGE\nnow, move this\n\n", },
Style = Input { Value = "Bold", },
ExtrusionProfile = Input {
SourceOp = "Text3D1_1ExtrusionProfile",
Source = "Value",
},
ManualFontKerningPlacement = Input {
Value = StyledText {
Array = {
},
Value = ""
},
},
},
ViewInfo = OperatorInfo { Pos = { 1805.67, 119.883 } },
},
Text3D1_1ExtrusionProfile = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.0666666666666667, 0.333333333333333 }, Flags = { Linear = true } },
[0.2] = { 1, LH = { 0.133333333333333, 0.666666666666667 }, RH = { 0.4, 1 }, Flags = { Linear = true } },
[0.8] = { 1, LH = { 0.6, 1 }, RH = { 0.866666666666667, 0.666666666666667 }, Flags = { Linear = true } },
[1] = { 0, LH = { 0.933333333333333, 0.333333333333333 }, Flags = { Linear = true } }
}
},
SplineColor = { Red = 192, Green = 128, Blue = 64 },
NameSet = true,
},
autoalignplane = Shape3D {
NameSet = true,
Inputs = {
SceneInput = Input {
SourceOp = "Helper",
Source = "Output",
},
["Transform3DOp.Translate.Y"] = Input { Value = 1.134, },
["Transform3DOp.Rotation"] = Input { Value = 0, },
["Transform3DOp.UseTarget"] = Input { Value = 1, },
["Transform3DOp.Target.X"] = Input {
SourceOp = "CoordTransform3D1",
Source = "Position.X",
},
["Transform3DOp.Target.Y"] = Input {
SourceOp = "CoordTransform3D1",
Source = "Position.Y",
},
["Transform3DOp.Target.Z"] = Input {
SourceOp = "CoordTransform3D1",
Source = "Position.Z",
},
["MtlStdInputs.MaterialID"] = Input { Value = 3, },
["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 5, }
},
ViewInfo = OperatorInfo {
Pos = { 1952.97, 12.8575 },
Flags = {
ShowPic = true
}
},
},
CoordTransform3D1 = CoordTransform3D {
CtrlWZoom = false,
Inputs = {
TargetObject = Input {
SourceOp = "LookAtMe",
Source = "Output",
},
SceneInput = Input {
SourceOp = "Merge3D1",
Source = "Output",
},
},
},
Helper = Shape3D {
NameSet = true,
Inputs = {
["Transform3DOp.Translate.Z"] = Input {
Value = 3,
Expression = "SurfaceCubeInputs.Depth/2",
},
Shape = Input { Value = FuID { "SurfaceCubeInputs" }, },
["MtlStdInputs.MaterialID"] = Input { Value = 4, },
["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 6, },
["SurfaceCubeInputs.SizeLock"] = Input { Value = 0, },
["SurfaceCubeInputs.Width"] = Input { Value = 0.04, },
["SurfaceCubeInputs.Height"] = Input { Value = 0.04, },
["SurfaceCubeInputs.Depth"] = Input { Value = 6, },
["SurfaceCubeInputs.ObjectID.ObjectID"] = Input { Value = 7, }
},
ViewInfo = OperatorInfo { Pos = { 2064.62, 13.037 } },
}
}
}
Last edited by Ignacio de La Cierva on Sun Jan 21, 2018 9:03 pm, edited 1 time in total.