<?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: Rotating an object's pivot using maxscript in 3ds Max Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775428#M94566</link>
    <description>&lt;P&gt;Here is a slightly more complex demo with a hierarchy of objects:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;fn RotatePivotOnly obj rotation = (
   local rotValInv=inverse (rotation as quat)
   animate off in coordsys local obj.rotation*=RotValInv
   obj.objectoffsetpos*=RotValInv
   obj.objectoffsetrot*=RotValInv
)
delete objects
t = teapot pos:[10,20,30] rotation:(eulerangles 45 45 12)
-- quickly create a hierarchy below the teapot
for i = 1 to 5 do (
	p = random (-150*[1,1,1]) (150*[1,1,1])
	b = box pos:p 
	if i&amp;lt;5 then (
		b.parent = t
	) else (
		b.parent = $Box001
	)
)

-- rotate teapot's pivot only
toolMode.coordsys #local
select t
for i = 1 to 5 do (
	format "rotation step %\n" i
	-- collect all children
	local cArray = for c in t.children collect c
	-- unlink all children
	for c in cArray do c.parent = undefined
	RotatePivotOnly t (EulerAngles 0 33 0)	-- rotate 33 deg around Y
	-- re-parent the children again
	for c in cArray do c.parent = t	
	redrawViews()
	sleep 0.3
)&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 20 Aug 2025 11:47:41 GMT</pubDate>
    <dc:creator>MartinBeh</dc:creator>
    <dc:date>2025-08-20T11:47:41Z</dc:date>
    <item>
      <title>Rotating an object's pivot using maxscript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775252#M94556</link>
      <description>&lt;P&gt;I'm trying to write a simple maxscript to rotate just the pivot of an object, i.e.: rotating with 'Affect Pivot Only' mode enabled. If I run the macro recorder it gives me this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;select $Root
rotate $ (angleaxis -90 [1,0,0])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The problem however is that this code rotates the object, not the pivot only. I've tried adding:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;maxOps.pivotMode = #pivotOnly&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But it still rotates the object.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What am I missing here?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2025 09:06:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775252#M94556</guid>
      <dc:creator>explosivepants</dc:creator>
      <dc:date>2025-08-20T09:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating an object's pivot using maxscript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775301#M94560</link>
      <description>&lt;P&gt;delete&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 06:08:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775301#M94560</guid>
      <dc:creator>A娘</dc:creator>
      <dc:date>2025-08-21T06:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating an object's pivot using maxscript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775385#M94561</link>
      <description>&lt;P&gt;From the &lt;A href="https://help.autodesk.com/view/MAXDEV/2025/ENU/?guid=GUID-3B001F21-8FE9-4663-A972-E648682A0ACD" target="_blank"&gt;online help&lt;/A&gt;:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;-- define function for rotating only the pivot point
fn RotatePivotOnly obj rotation = (
   local rotValInv=inverse (rotation as quat)
   animate off in coordsys local obj.rotation*=RotValInv
   obj.objectoffsetpos*=RotValInv
   obj.objectoffsetrot*=RotValInv
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 20 Aug 2025 11:05:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775385#M94561</guid>
      <dc:creator>MartinBeh</dc:creator>
      <dc:date>2025-08-20T11:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating an object's pivot using maxscript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775391#M94562</link>
      <description>&lt;P&gt;This is rotating the entire object and its child objects for me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2025 11:12:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775391#M94562</guid>
      <dc:creator>explosivepants</dc:creator>
      <dc:date>2025-08-20T11:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating an object's pivot using maxscript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775393#M94563</link>
      <description>&lt;P&gt;Sorry but this rotated the entire object and subobjects on my end for some reason.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2025 11:14:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775393#M94563</guid>
      <dc:creator>explosivepants</dc:creator>
      <dc:date>2025-08-20T11:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating an object's pivot using maxscript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775401#M94564</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/17805156"&gt;@explosivepants&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This is rotating the entire object and its child objects for me.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Seems to work for me. Can you post a .max file?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2025 11:20:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775401#M94564</guid>
      <dc:creator>MartinBeh</dc:creator>
      <dc:date>2025-08-20T11:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating an object's pivot using maxscript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775408#M94565</link>
      <description>&lt;P&gt;Here is a short demo:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;fn RotatePivotOnly obj rotation = (
   local rotValInv=inverse (rotation as quat)
   animate off in coordsys local obj.rotation*=RotValInv
   obj.objectoffsetpos*=RotValInv
   obj.objectoffsetrot*=RotValInv
)
delete objects
t = teapot pos:[10,20,30] rotation:(eulerangles 45 45 12)
b = box pos:[-10,-20,-30] parent:t
toolMode.coordsys #local
select t
for i = 1 to 5 do (
	format "rotation step %\n" i
	RotatePivotOnly t (EulerAngles 0 33 0)	-- rotate 33 deg around Y
	redrawViews()
	sleep 0.3
)&lt;/LI-CODE&gt;
&lt;P&gt;and yes, the children will be rotated, too, as they are relative to the the parent's pivot, so if you rotate the pivot this will be inherited.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2025 11:29:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775408#M94565</guid>
      <dc:creator>MartinBeh</dc:creator>
      <dc:date>2025-08-20T11:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating an object's pivot using maxscript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775428#M94566</link>
      <description>&lt;P&gt;Here is a slightly more complex demo with a hierarchy of objects:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;fn RotatePivotOnly obj rotation = (
   local rotValInv=inverse (rotation as quat)
   animate off in coordsys local obj.rotation*=RotValInv
   obj.objectoffsetpos*=RotValInv
   obj.objectoffsetrot*=RotValInv
)
delete objects
t = teapot pos:[10,20,30] rotation:(eulerangles 45 45 12)
-- quickly create a hierarchy below the teapot
for i = 1 to 5 do (
	p = random (-150*[1,1,1]) (150*[1,1,1])
	b = box pos:p 
	if i&amp;lt;5 then (
		b.parent = t
	) else (
		b.parent = $Box001
	)
)

-- rotate teapot's pivot only
toolMode.coordsys #local
select t
for i = 1 to 5 do (
	format "rotation step %\n" i
	-- collect all children
	local cArray = for c in t.children collect c
	-- unlink all children
	for c in cArray do c.parent = undefined
	RotatePivotOnly t (EulerAngles 0 33 0)	-- rotate 33 deg around Y
	-- re-parent the children again
	for c in cArray do c.parent = t	
	redrawViews()
	sleep 0.3
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 20 Aug 2025 11:47:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775428#M94566</guid>
      <dc:creator>MartinBeh</dc:creator>
      <dc:date>2025-08-20T11:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating an object's pivot using maxscript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775861#M94567</link>
      <description>&lt;P&gt;delete&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 06:08:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13775861#M94567</guid>
      <dc:creator>A娘</dc:creator>
      <dc:date>2025-08-21T06:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating an object's pivot using maxscript</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13776465#M94569</link>
      <description>&lt;P&gt;Thank you for this example. Looks like I need to unlink the child objects first before rotating then relink again.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 01:47:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/rotating-an-object-s-pivot-using-maxscript/m-p/13776465#M94569</guid>
      <dc:creator>explosivepants</dc:creator>
      <dc:date>2025-08-21T01:47:04Z</dc:date>
    </item>
  </channel>
</rss>

