<?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: Setting Up a Custom Attribute for Rotation in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/setting-up-a-custom-attribute-for-rotation/m-p/11281426#M4017</link>
    <description>&lt;P&gt;Hey Denis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I'm starting to understand your example.&lt;/P&gt;&lt;P&gt;However, I will still need to use a custom attribute so that the rotation is animatable, though I was able to create one now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One question - I created a custom attribute named spin on my dummy object; I selected a box that I have in the scene and assigned a script controller to the y_rotation so that it equaled $Dummy001.spin. However, when I animate that $Dummy001.Spin attribute in trackview, the default is still in radians, and the box rotates severely because it is radians.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know of a way to change it so that it rotates the object by degrees and not radians?&lt;/P&gt;&lt;P&gt;This would make the rest of the project significantly easier - one of the final pieces of the puzzle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jul 2022 20:43:19 GMT</pubDate>
    <dc:creator>ttazinazzo</dc:creator>
    <dc:date>2022-07-06T20:43:19Z</dc:date>
    <item>
      <title>Setting Up a Custom Attribute for Rotation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/setting-up-a-custom-attribute-for-rotation/m-p/11264382#M4010</link>
      <description>&lt;P&gt;Hey all - hopefully the last newbie question for a little while.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For coherence between business projects, I will need to create a Custom Attribute that is tied to the X-Rotation wire of an object in my scene. The custom attribute is named T-Beam rotation and was created as a Float parameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am linking it to the X Rotation of my object through Parameter Wiring, however I am noticing that the custom attribute value is not equaling the rotation value shown in the rotation transform.&amp;nbsp;&lt;SPAN&gt;If my object is rotated at 20 degrees I want the custom attribute to show 20 degrees as well. Instead, a small example value of 0.1 on the custom attribute rotates the object significantly (45 degrees or so) and I'm not sure why.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm thinking it might be because of an inconsistency between radians and degrees?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'd like it to all show in degrees, so I have updated the wiring parameter expression with the below but it doesn't seem to change anything:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wiring.PNG" style="width: 702px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1085309i82752F43E35235D4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Wiring.PNG" alt="Wiring.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Any idea on how I can just set the Custom Attribute directly equal to the rotational degree reading of the object?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 16:13:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/setting-up-a-custom-attribute-for-rotation/m-p/11264382#M4010</guid>
      <dc:creator>ttazinazzo</dc:creator>
      <dc:date>2022-06-28T16:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Up a Custom Attribute for Rotation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/setting-up-a-custom-attribute-for-rotation/m-p/11264579#M4011</link>
      <description>&lt;P&gt;First, the wiring of a single component of Euler XYZ is not the best and trustworthy constraint. It's better to use an Orientation constraint.&lt;/P&gt;&lt;P&gt;Anyway... the rotation controller values are in&amp;nbsp; radians, but you need degrees. So use &lt;STRONG&gt;radtodeg / degtorad&lt;/STRONG&gt; for conversion.&lt;/P&gt;&lt;P&gt;Second, as I see from your task description above, you don't need two-way-connection. Use a simple one-way.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 17:45:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/setting-up-a-custom-attribute-for-rotation/m-p/11264579#M4011</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2022-06-28T17:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Up a Custom Attribute for Rotation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/setting-up-a-custom-attribute-for-rotation/m-p/11264606#M4012</link>
      <description>&lt;P&gt;Oh, I wasn't aware that there was a command for the conversion.&lt;/P&gt;&lt;P&gt;If I understand correct, would this be the right format? :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NewWiring.PNG" style="width: 702px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1085355i2008389637B13403/image-size/large?v=v2&amp;amp;px=999" role="button" title="NewWiring.PNG" alt="NewWiring.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Even when I update it with that it still gives me wonky rotations.&lt;/P&gt;&lt;P&gt;Maybe it would just be easier to do it through an orientation constraint?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 17:59:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/setting-up-a-custom-attribute-for-rotation/m-p/11264606#M4012</guid>
      <dc:creator>ttazinazzo</dc:creator>
      <dc:date>2022-06-28T17:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Up a Custom Attribute for Rotation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/setting-up-a-custom-attribute-for-rotation/m-p/11264661#M4013</link>
      <description>&lt;P&gt;first, make your Euler XYZ a List Rotation Controller, when the first item of the list is an initial value and the second is offset. You need the offset as I understand...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 18:27:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/setting-up-a-custom-attribute-for-rotation/m-p/11264661#M4013</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2022-06-28T18:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Up a Custom Attribute for Rotation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/setting-up-a-custom-attribute-for-rotation/m-p/11264972#M4014</link>
      <description>&lt;P&gt;here is how I would do:&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;try(delete ca) catch()

angx_ca = attributes angx_ca attribid:#(12346,64321)
(
	parameters params rollout:params
	(
		target type:#node 
		angle type:#float ui:ui_angle
	)
	
	rollout params "CA: Angle Constraint" width:191
	(
		spinner ui_angle "Angle: " type:#float range:[-1e6,1e6,0] fieldwidth:64 align:#right offset:[4,4]

		button make_bt "Make Example" width:172 align:#center offset:[0,4]
		
		fn makeAngleConstraint = 
		(
			delete objects
			p = dummy name:#base boxsize:[8,8,8]
			
			-- Make rotation local by using parenting
			t = point name:#target parent:p size:10 box:on cross:on axistripod:on wirecolor:orange isselected:on
			
			-- lock Y and Z, leave only X free
			lockedtracksman.setlocks on t.rotation.controller[2] undefined -1 off 
			lockedtracksman.setlocks on t.rotation.controller[3] undefined -1 off
			
			t 
		)
		
		
		on make_bt pressed do undo "Make Dist&amp;amp;Ang" on
		(
			target = makeAngleConstraint()
			c = angle.controller = float_script()
			c.addtarget #angle target.rotation.controller[1]
			c.script = @"angle"
		)
		
		on params open do
		(
		)
	)
)
ca = createinstance angx_ca
createdialog ca.params&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;of course the CA need not be necessarily "standalone".&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 21:31:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/setting-up-a-custom-attribute-for-rotation/m-p/11264972#M4014</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2022-06-28T21:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Up a Custom Attribute for Rotation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/setting-up-a-custom-attribute-for-rotation/m-p/11267555#M4015</link>
      <description>&lt;P&gt;So I'm reviewing the code you wrote and reviewing the project needs and I'm thinking I actually don't need a custom attribute, but instead need to create a script controller on a trackview node that is equal to the rotation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Essentially we created a trackview node now named Beam, with subnodes "Position" "Velocity" and "Acceleration".&lt;/P&gt;&lt;P&gt;The "Position" subnode would need to have a script controller equaling the y-rotation controller of the object in the scene so that we can animate that object using that "Beam" node, "Position" subnode in trackview.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to do a simple code like this:&lt;/P&gt;&lt;P&gt;nController = float_script()&lt;/P&gt;&lt;P&gt;nController.script = "object001.rotation.controller.y_rotation.controller"&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;nController = float_script()&lt;/P&gt;&lt;P&gt;object001.rotation.controller.y_rotation.controller = nController&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I keep getting the same error:&lt;/P&gt;&lt;P&gt;-- Unknown property: "rotation" in undefined&lt;BR /&gt;-- MAXScript callstack:&lt;BR /&gt;-- thread data: threadID:24908&lt;BR /&gt;-- ------------------------------------------------------&lt;BR /&gt;-- [stack level: 0]&lt;BR /&gt;-- In top-level&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to use your code to achieve this?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 19:34:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/setting-up-a-custom-attribute-for-rotation/m-p/11267555#M4015</guid>
      <dc:creator>ttazinazzo</dc:creator>
      <dc:date>2022-06-29T19:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Up a Custom Attribute for Rotation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/setting-up-a-custom-attribute-for-rotation/m-p/11267821#M4016</link>
      <description>&lt;P&gt;It's up to you if you want "simple"... I show how to do it right.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 22:11:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/setting-up-a-custom-attribute-for-rotation/m-p/11267821#M4016</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2022-06-29T22:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Up a Custom Attribute for Rotation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/setting-up-a-custom-attribute-for-rotation/m-p/11281426#M4017</link>
      <description>&lt;P&gt;Hey Denis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I'm starting to understand your example.&lt;/P&gt;&lt;P&gt;However, I will still need to use a custom attribute so that the rotation is animatable, though I was able to create one now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One question - I created a custom attribute named spin on my dummy object; I selected a box that I have in the scene and assigned a script controller to the y_rotation so that it equaled $Dummy001.spin. However, when I animate that $Dummy001.Spin attribute in trackview, the default is still in radians, and the box rotates severely because it is radians.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know of a way to change it so that it rotates the object by degrees and not radians?&lt;/P&gt;&lt;P&gt;This would make the rest of the project significantly easier - one of the final pieces of the puzzle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 20:43:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/setting-up-a-custom-attribute-for-rotation/m-p/11281426#M4017</guid>
      <dc:creator>ttazinazzo</dc:creator>
      <dc:date>2022-07-06T20:43:19Z</dc:date>
    </item>
  </channel>
</rss>

