<?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: Deselecting selected after unhide a child in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/deselecting-selected-after-unhide-a-child/m-p/12753054#M1069</link>
    <description>&lt;P&gt;Do you want to have fun with ChatGPT or learn MXS?&lt;BR /&gt;If the former, then you can continue... if the latter, then:&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;fn sync_camera_sel =
(
	for c in cameras where iskindof c Camera do 
	(
		if c.isselected then selectmore c.children else deselect c.children
	)
	ok
)

callbacks.removescripts id:#sync_camera_sel
callbacks.addscript #selectionSetChanged "sync_camera_sel()" id:#sync_camera_sel&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>Sat, 04 May 2024 23:09:01 GMT</pubDate>
    <dc:creator>denisT.MaxDoctor</dc:creator>
    <dc:date>2024-05-04T23:09:01Z</dc:date>
    <item>
      <title>Deselecting selected after unhide a child</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/deselecting-selected-after-unhide-a-child/m-p/12752862#M1068</link>
      <description>&lt;P&gt;Good day to all!&lt;BR /&gt;I am very very new to the maxscript and to the English language too&lt;BR /&gt;I had a lot of fun programming the script via ChatGT, but I &lt;SPAN&gt;encountered&lt;/SPAN&gt;&amp;nbsp;a problem that it can't solve.&lt;BR /&gt;Task: When selecting one of several cameras, it is necessary that the child plane to it is unhide.&lt;BR /&gt;Problem: The planes are displayed as they should be, but when clicking on an unselected camera, if the plane was previously hidden, the selection is removed from the camera. This only happens when the camera is selected onclick. If you select the camera with a selection area or in layers, then the selection stays. The selection also remains if the linked plane to the camera has not been hidden.&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;try(destroydialog myRollout)catch()
rollout myRollout "MyRollout" width:140 height:265 (

fn SelectionChanged = 
	(
	selection[1].children.ishidden = false
	)

on myRollout open do(
callbacks.removescripts id:#MySelectionChange
callbacks.addscript #selectionSetChanged "myRollout.SelectionChanged()" id:#MySelectionChange
)
on myRollout close do 	(callbacks.removescripts id:#MySelectionChange)	
)	
createdialog myRollout&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>Sat, 04 May 2024 19:04:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/deselecting-selected-after-unhide-a-child/m-p/12752862#M1068</guid>
      <dc:creator>iqbot</dc:creator>
      <dc:date>2024-05-04T19:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Deselecting selected after unhide a child</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/deselecting-selected-after-unhide-a-child/m-p/12753054#M1069</link>
      <description>&lt;P&gt;Do you want to have fun with ChatGPT or learn MXS?&lt;BR /&gt;If the former, then you can continue... if the latter, then:&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;fn sync_camera_sel =
(
	for c in cameras where iskindof c Camera do 
	(
		if c.isselected then selectmore c.children else deselect c.children
	)
	ok
)

callbacks.removescripts id:#sync_camera_sel
callbacks.addscript #selectionSetChanged "sync_camera_sel()" id:#sync_camera_sel&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>Sat, 04 May 2024 23:09:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/deselecting-selected-after-unhide-a-child/m-p/12753054#M1069</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-05-04T23:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Deselecting selected after unhide a child</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/deselecting-selected-after-unhide-a-child/m-p/12753084#M1070</link>
      <description>&lt;P&gt;I removed the previous solution and replaced it with a simple one. And everything seems to work well, but this simplified solution has some issues... that can be discovered during more thorough testing.&amp;nbsp;&lt;BR /&gt;The ability to anticipate problems sets an experienced developer apart from ChatGPT.&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 23:23:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/deselecting-selected-after-unhide-a-child/m-p/12753084#M1070</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-05-04T23:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Deselecting selected after unhide a child</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/deselecting-selected-after-unhide-a-child/m-p/12754119#M1071</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;Thank&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;you&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;your&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;reply&lt;/SPAN&gt;. I find such code beautiful, even though I don't understand some parts of it. Ok, now I've found out about the camera collection, it will be useful in other parts of my script.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;However,&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;this example&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;doesn't&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;seem to directly&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;solve my problem or&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;I'm&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;not&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;sure&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;how it&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;could&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;help.&lt;/SPAN&gt; &lt;SPAN class=""&gt;Perhaps&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;I&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;didn't&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;describe the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;issue&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;clearly enough.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Using the example of this code, if we replace "selectmore c.children" with "hide c.children" we will get about what I need, but the problem itself will remain. And it lies in the fact that with a single click on the camera in the viewport window, the camera selects for a moment, the child hides, but then the selection from the camera disappears. At the same time, the camera remains selected if you select it not with a single click, but with the selection area.&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;for c in cameras where iskindof c Camera do 
	(
		if c.isselected then hide c.children else deselect c.children
	)
	ok&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS: I don't claim to be an experienced developer, because I started studying the script three days ago, without having proper programming experience in general. &lt;SPAN class=""&gt;I was&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;able&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;to achieve&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;the result I&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;wanted&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and it&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;helped&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;speed&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;up&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;my&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;team's work&lt;/SPAN&gt;&lt;SPAN class=""&gt;, but I&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;still want to&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;work&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;on&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;improving&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;some&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;aspects&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;of&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;the script&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;to&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;make&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;it work&lt;SPAN&gt;&amp;nbsp;a little&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;more&amp;nbsp;beautiful.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2024 21:15:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/deselecting-selected-after-unhide-a-child/m-p/12754119#M1071</guid>
      <dc:creator>iqbot</dc:creator>
      <dc:date>2024-05-05T21:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Deselecting selected after unhide a child</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/deselecting-selected-after-unhide-a-child/m-p/12754172#M1072</link>
      <description>&lt;P&gt;first of all, you need to clearly define the goal you want to achieve. for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the goal description:&lt;BR /&gt;&lt;EM&gt;- when you select any camera object, all its children need to be un-hided and selected as well&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- all unselected camera children must be unselected and hidden&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is called a "terms of reference" or a "technical specifications" ...&lt;/P&gt;&lt;P&gt;the more precise it is, the more likely it will be understood correctly and you will get what you need.&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2024 22:35:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/deselecting-selected-after-unhide-a-child/m-p/12754172#M1072</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-05-05T22:35:41Z</dc:date>
    </item>
  </channel>
</rss>

