<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: the referencing of a controller in MaxScript in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12280248#M1920</link>
    <description>&lt;P&gt;You're working with expression controllers the wrong way....&lt;/P&gt;&lt;P&gt;(I'm not talking about syntax errors now, but the concept as a whole)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;look at my example, use MXS help to understand, ask questions if something is not clear:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(
	delete objects

	bx = box wirecolor:green
	cn = cone wirecolor:orange 
	bx.height.controller = linear_float()

	z_ex = cn.pos.controller[3].controller = float_expression()
	z_ex.addscalartarget "rise" bx.height.controller -- one way to pass a controller 
	z_ex.setexpression "rise"

	h_ex = cn.radius1.controller = float_expression()
	h_ex.addscalartarget "base" bx.baseobject[#height] -- another way to pass a controller
	h_ex.setexpression "base / sqrt(2)"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This example uses expression controllers to bind the 'z-position' and 'radius 1' of the cone with the height of the box.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Oct 2023 19:24:28 GMT</pubDate>
    <dc:creator>denisT.MaxDoctor</dc:creator>
    <dc:date>2023-10-02T19:24:28Z</dc:date>
    <item>
      <title>the referencing of a controller in MaxScript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12278908#M1915</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello everyone,&lt;BR /&gt;&lt;BR /&gt;I'm a beginner and I'm stuck with the logic of the referencing of a controller in MaxScript.&lt;BR /&gt;I'm trying to create a script that requires referencing a controller that has either been created by a script or not. Despite reading the documentation, I'm feeling a bit lost...&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Is it possible to give a name to a controller when it's created? (the MaxScript listener remains silent when I rename it manually).&amp;nbsp;&lt;SPAN&gt;I tried to add, without success, the line 'fs.name = "my_controller_name"' just after 'fs = Float_Expression()'.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;If not, how can I reference a 'Float Expression' controller since MaxScript doesn't seem to recognize the syntax 'Float Expression.controller' or 'Float_Expression.controller'?&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;masterRot = $Wheel_00

-- Point gizmo creation
pointObj = Point box:on size:5 pos:selectedObj.pivot

-- Add Float Expression controller to the point object
pointObj.rotation.controller.Z_Rotation.controller = float_list ()
fs = Float_Expression ()
pointObj.rotation.controller.Z_Rotation.controller.Available.controller = fs

-- //!\\ problematic line doing error: trying to do a connection with a controller on an other object
masterRotCtrl = execute (masterRot.name as string +".rotation.controller.Z_Rotation.controller.Float Expression.controller")

-- Filling the expression of the float expression controller
fs.addScalarTarget "Rot" masterRotCtrl
fs.addScalarConstant "n" nT
fs.addScalarConstant "nR" nTR
fs.SetExpression "-Rot/(n/nR)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance,&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 09:07:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12278908#M1915</guid>
      <dc:creator>richardGRWZS</dc:creator>
      <dc:date>2023-10-02T09:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: the referencing of a controller in MaxScript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12278973#M1916</link>
      <description>&lt;LI-CODE lang="general"&gt;cc = float_list()
ln = cc.available.controller = linear_float()
cc.setname 1 "Linear"
ex = cc.available.controller = float_expression()
cc.setname 2 "Expression"

cc[#linear].controller == ln
cc[#expression].controller == ex&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 02 Oct 2023 09:46:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12278973#M1916</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2023-10-02T09:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: the referencing of a controller in MaxScript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12279089#M1917</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you for your response!&lt;BR /&gt;&lt;BR /&gt;I understand now how to set a name, I'm almost there. But there is still an unknown area for me:&lt;BR /&gt;If I understand correctly, a controller is like an object that you need to know the path to access, but I didn't understand how I can "reconstruct" this path when I don't have access to it directly in a variable !&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I take back my exemple updated with your explanations:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;masterRot = $Wheel_00

-- Point gizmo creation
pointObj = Point box:on size:5 pos:selectedObj.pivot

-- Add Float Expression controller to the point object
local cc = pointObj.rotation.controller.Z_Rotation.controller 
cc = float_list ()
cc.available.controller = linear_float()
cc.setname 1 "Manual_Adjst"
fs = cc.available.controller = float_expression()
cc.setname 2 "SlaveRot"

-- Filling the expression of the float expression controller
-- //!\\ Problematic line: "syntax error: at [, expected name"
masterRotCtrl = execute ("$"+ masterRot.name as string +".Rotation.controller.Z_Rotation.controller.[#SlaveRot].controller")

fs.addScalarTarget "MasterRot" masterRotCtrl
fs.addScalarConstant "n" nT
fs.addScalarConstant "nR" nTR
fs.SetExpression "-MasterRot/(n/nR)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So there is something wrong with this line 16 because i still don't anderstand how to build the path to target a specific controller :&lt;BR /&gt;masterRotCtrl = execute ("$"+ masterRot.name as string +".Rotation.controller.Z_Rotation.controller.[#SlaveRot].controller")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried with [#SlaveRot] &amp;gt; syntax error: at [, expected name&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried also simply with 'SlaveRot' &amp;gt; error: Unknown property: "rotation" in undefined&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you again in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 11:41:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12279089#M1917</guid>
      <dc:creator>richardGRWZS</dc:creator>
      <dc:date>2023-10-02T11:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: the referencing of a controller in MaxScript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12279648#M1918</link>
      <description>&lt;P&gt;As you want to use "execute()" I'd enter&lt;/P&gt;&lt;P&gt;&amp;nbsp; $MASTERROTNAME.rotation.controller.Z_Rotation.controller.[#SlaveRot].controller&lt;/P&gt;&lt;P&gt;in the MXS listener and check why this line is outputting an error..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 15:07:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12279648#M1918</guid>
      <dc:creator>istan</dc:creator>
      <dc:date>2023-10-02T15:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: the referencing of a controller in MaxScript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12279849#M1919</link>
      <description>&lt;P&gt;You think the logic of the syntax is good but it's just a problem with my actual scene test ?&lt;/P&gt;&lt;P&gt;Here is a screenshot of my test with the manual request in the listener:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="expression_problem.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1274188i993E3807F651D382/image-size/large?v=v2&amp;amp;px=999" role="button" title="expression_problem.png" alt="expression_problem.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 16:25:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12279849#M1919</guid>
      <dc:creator>richardGRWZS</dc:creator>
      <dc:date>2023-10-02T16:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: the referencing of a controller in MaxScript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12280248#M1920</link>
      <description>&lt;P&gt;You're working with expression controllers the wrong way....&lt;/P&gt;&lt;P&gt;(I'm not talking about syntax errors now, but the concept as a whole)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;look at my example, use MXS help to understand, ask questions if something is not clear:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(
	delete objects

	bx = box wirecolor:green
	cn = cone wirecolor:orange 
	bx.height.controller = linear_float()

	z_ex = cn.pos.controller[3].controller = float_expression()
	z_ex.addscalartarget "rise" bx.height.controller -- one way to pass a controller 
	z_ex.setexpression "rise"

	h_ex = cn.radius1.controller = float_expression()
	h_ex.addscalartarget "base" bx.baseobject[#height] -- another way to pass a controller
	h_ex.setexpression "base / sqrt(2)"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This example uses expression controllers to bind the 'z-position' and 'radius 1' of the cone with the height of the box.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 19:24:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12280248#M1920</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2023-10-02T19:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: the referencing of a controller in MaxScript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12280608#M1921</link>
      <description>&lt;P&gt;Thanks a lot for your help !&lt;/P&gt;&lt;P&gt;I feel stupid it tooks me so long to get it&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;It works fine for me now, so y&lt;SPAN&gt;ou can find below the modified code with what I understood from your comments:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;masterRot = $Wheel_00

-- Point gizmo creation
pointObj = Point box:on size:5 pos:selectedObj.pivot

-- Add Float List controller to the point object
fs = pointObj.rotation.controller[3].controller = float_list ()

-- Rename the default "Bezier float" controller
fs.setname 1 "Manual_Adjst"

-- Création and filling the "Float Expression" controller
cc = float_expression()
masterRotCtrl = execute ("$"+ masterRot.name as string +".rotation.controller[3].controller.SlaveRot.controller")
cc.addScalarTarget "MasterRot" masterRotCtrl			
cc.addScalarConstant "n" 10
cc.addScalarConstant "nR" 40
cc.SetExpression "-MasterRot/(n/nR)"

-- Apply the "Float Expression" controller and rename it
fs[2].controller = cc
fs.setname 2 "SlaveRot"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If it can help other noob like me&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;BR /&gt;Thanks again and please don't hesitate to provide further feedback on the script exemple, even if it's working fine!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 22:44:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12280608#M1921</guid>
      <dc:creator>richardGRWZS</dc:creator>
      <dc:date>2023-10-02T22:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: the referencing of a controller in MaxScript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12280734#M1922</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14544718"&gt;@richardGRWZS&lt;/a&gt;&amp;nbsp;wrote:&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;masterRotCtrl = execute ("$"+ masterRot.name as string +".rotation.controller[3].controller.SlaveRot.controller")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It doesn't make sense to me. That's how it should be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;masterRotCtrl = masterRot.rotation.controller[3].controller.SlaveRot.controller&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 00:01:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12280734#M1922</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2023-10-03T00:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: the referencing of a controller in MaxScript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12280797#M1923</link>
      <description>&lt;P&gt;&lt;SPAN&gt;You are absolutely right; it's a remnant from the original script that I haven't cleaned up.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In my original script, 'masterRot' doesn't directly target the object I want. I need to add the prefix 'H_' to get it.&lt;BR /&gt;This results in: execute ("$H_"+ masterRot.name as string + "...")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 01:06:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12280797#M1923</guid>
      <dc:creator>richardGRWZS</dc:creator>
      <dc:date>2023-10-03T01:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: the referencing of a controller in MaxScript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12280930#M1924</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14544718"&gt;@richardGRWZS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&lt;SPAN&gt;You are absolutely right; it's a remnant from the original script that I haven't cleaned up.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In my original script, 'masterRot' doesn't directly target the object I want. I need to add the prefix 'H_' to get it.&lt;BR /&gt;This results in: execute ("$H_"+ masterRot.name as string + "...")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Using "execute" is completely irrelevant in this case.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 03:17:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/the-referencing-of-a-controller-in-maxscript/m-p/12280930#M1924</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2023-10-03T03:17:54Z</dc:date>
    </item>
  </channel>
</rss>

