<?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: Get all Material/texture nodes connected to certain Material or Texture in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/get-all-material-texture-nodes-connected-to-certain-material-or/m-p/10967445#M4454</link>
    <description>&lt;P&gt;Then you use &lt;FONT face="courier new,courier"&gt;getSubTexmap&lt;/FONT&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;fn isSubTexmap m ref is:false = 
(
	for i = 1 to getNumSubTexmaps m where getSubTexmap m i == ref do is = true
	return is
)

dependentMaterials = for r in refs.dependents map where isKindOf r Material and isSubTexmap r map collect r&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 23 Feb 2022 14:31:04 GMT</pubDate>
    <dc:creator>Swordslayer</dc:creator>
    <dc:date>2022-02-23T14:31:04Z</dc:date>
    <item>
      <title>Get all Material/texture nodes connected to certain Material or Texture</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/get-all-material-texture-nodes-connected-to-certain-material-or/m-p/10967170#M4451</link>
      <description>&lt;P&gt;I need a solution to get all material/texture nodes connected to the Output of certain Texture or Material.&lt;/P&gt;&lt;P&gt;Material class has methods&amp;nbsp;&lt;EM&gt;&lt;SPAN class=""&gt;getSubMtl&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN class=""&gt;and&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class=""&gt;getSubTexmap &lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN class=""&gt;which returns all materials and textured connected to material. But I wonder why it don't have a method for getting output connections.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;For example I have a Bitmaptexture which is connected to diffuse slot of material1 and diffuse slot of material2. How I can get this material objects?..&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 12:29:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/get-all-material-texture-nodes-connected-to-certain-material-or/m-p/10967170#M4451</guid>
      <dc:creator>denisVFX</dc:creator>
      <dc:date>2022-02-23T12:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Get all Material/texture nodes connected to certain Material or Texture</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/get-all-material-texture-nodes-connected-to-certain-material-or/m-p/10967299#M4452</link>
      <description>&lt;P&gt;You can get dependents of the map, and filter them based on your criteria. For example, if &lt;FONT face="courier new,courier"&gt;map&lt;/FONT&gt; is the texture:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;dependentMaterials = for r in refs.dependents map where isKindOf r Material and not isKindOf r TextureMap collect r&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Feb 2022 13:22:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/get-all-material-texture-nodes-connected-to-certain-material-or/m-p/10967299#M4452</guid>
      <dc:creator>Swordslayer</dc:creator>
      <dc:date>2022-02-23T13:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get all Material/texture nodes connected to certain Material or Texture</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/get-all-material-texture-nodes-connected-to-certain-material-or/m-p/10967373#M4453</link>
      <description>&lt;P&gt;Thank you for a quick reply.&lt;/P&gt;&lt;P&gt;It works but collets all the nodes which are higher in hierarchy. But I need only nodes which are connected to this texture (or material)&lt;/P&gt;&lt;LI-CODE lang="general"&gt;map = meditMaterials[1].map2.texmap_diffuse
dependentMaterials = for r in refs.dependents map where isKindOf r Material or isKindOf r TextureMap collect r
for i in dependentMaterials do 
(
	print i.name
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="general"&gt;kerosene_lamp_body_Diffuse_map:Bitmap
#(kerosene_lamp_body_metallic_mat:VRayMtl, kerosene_lamp_body_mat:Blend, kerosene_lamp_body_dielectric_mat:VRayMtl)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 vraymaterials and 1 blend material are in&amp;nbsp;dependentMaterials , but Diffuse bitmap texture isn't connected to blend material....&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="ref_dependencies.jpg" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1028735iC738F13059341A50/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ref_dependencies.jpg" alt="ref_dependencies.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;is there any way to filter refs.dependents result so it will return only nodes which has direct connection the node?...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 13:56:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/get-all-material-texture-nodes-connected-to-certain-material-or/m-p/10967373#M4453</guid>
      <dc:creator>denisVFX</dc:creator>
      <dc:date>2022-02-23T13:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Get all Material/texture nodes connected to certain Material or Texture</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/get-all-material-texture-nodes-connected-to-certain-material-or/m-p/10967445#M4454</link>
      <description>&lt;P&gt;Then you use &lt;FONT face="courier new,courier"&gt;getSubTexmap&lt;/FONT&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;fn isSubTexmap m ref is:false = 
(
	for i = 1 to getNumSubTexmaps m where getSubTexmap m i == ref do is = true
	return is
)

dependentMaterials = for r in refs.dependents map where isKindOf r Material and isSubTexmap r map collect r&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Feb 2022 14:31:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/get-all-material-texture-nodes-connected-to-certain-material-or/m-p/10967445#M4454</guid>
      <dc:creator>Swordslayer</dc:creator>
      <dc:date>2022-02-23T14:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Get all Material/texture nodes connected to certain Material or Texture</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/get-all-material-texture-nodes-connected-to-certain-material-or/m-p/10967478#M4455</link>
      <description>&lt;P&gt;Thank you! It works excellent!&lt;/P&gt;&lt;P&gt;But I if there any easy and elegant way to find to which texture slot output connection is connected? (is it diffuse map, or reflection, or maybe it's connected to mix texture map color 1... )&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 14:49:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/get-all-material-texture-nodes-connected-to-certain-material-or/m-p/10967478#M4455</guid>
      <dc:creator>denisVFX</dc:creator>
      <dc:date>2022-02-23T14:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Get all Material/texture nodes connected to certain Material or Texture</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/get-all-material-texture-nodes-connected-to-certain-material-or/m-p/10967503#M4456</link>
      <description>&lt;P&gt;Since it's going through all the slots anyway, it's easy to save the slotname in the same pass...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;fn isSubTexmap m ref &amp;amp;slotName is:false = 
(
	for i = 1 to getNumSubTexmaps m where getSubTexmap m i == ref do (slotName = getSubTexmapSlotName m i; is = true)
	return is
)

dependentMaterials = for r in refs.dependents map where isKindOf r Material and isSubTexmap r map &amp;amp;slotName collect dataPair val:r slot:slotName&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Feb 2022 15:01:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/get-all-material-texture-nodes-connected-to-certain-material-or/m-p/10967503#M4456</guid>
      <dc:creator>Swordslayer</dc:creator>
      <dc:date>2022-02-23T15:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Get all Material/texture nodes connected to certain Material or Texture</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/get-all-material-texture-nodes-connected-to-certain-material-or/m-p/10968137#M4457</link>
      <description>&lt;P&gt;since this task does not require a real-time solution and is not particularly time-critical, I would go the other way:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;fn getTextureMapDirectConnections map = 
(
	cls = classof map
	tvps = getclassinstances cls astrackviewpick:on
	cc = for tvp in tvps where tvp.anim == map collect tvp 
)	

tt = getTextureMapDirectConnections map
-- where tt is a list of trackviewpicks... see MXS help for details:&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;TrackViewPick&lt;/STRONG&gt;&lt;/FONT&gt; : Value&lt;BR /&gt;&lt;FONT size="3"&gt;Instances of the TrackViewPick class store the result of a selection from the Track View Pick dialog. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A TrackViewPick value has the following properties:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000"&gt;&lt;STRONG&gt;&amp;lt;trackViewPick&amp;gt;.name&lt;/STRONG&gt;&lt;/FONT&gt; : string&lt;/P&gt;&lt;P&gt;The name of the picked item as shown in the Track View Pick dialog.&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;STRONG&gt;&amp;lt;trackViewPick&amp;gt;.anim&lt;/STRONG&gt;&lt;/FONT&gt; : subAnim&lt;/P&gt;&lt;P&gt;The subAnim for the item the user picked.&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;STRONG&gt;&amp;lt;trackViewPick&amp;gt;.client&lt;/STRONG&gt;&lt;/FONT&gt; : MAXWrapper&lt;/P&gt;&lt;P&gt;The owner of the subAnim for the item the user picked. If the owner is a subclass of MAXWrapper, the MAXWrapper value for the owner is returned, otherwise a value of undefined is returned.&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;STRONG&gt;&amp;lt;trackViewPick&amp;gt;.subNum&lt;/STRONG&gt;&lt;/FONT&gt; : integer&lt;/P&gt;&lt;P&gt;The subAnim index for anim in client.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course, we can always filter the list by client class or subAmin name (property).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 19:14:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/get-all-material-texture-nodes-connected-to-certain-material-or/m-p/10968137#M4457</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2022-02-23T19:14:15Z</dc:date>
    </item>
  </channel>
</rss>

