<?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: HUD Display name of selected object in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/hud-display-name-of-selected-object/m-p/10710149#M3450</link>
    <description>&lt;P&gt;So I've got it to print the correct result in the script editor&lt;BR /&gt;&lt;BR /&gt;But still trying to figure out how to make it work inside a global proc so it can be displayed in the HUD&lt;BR /&gt;&lt;BR /&gt;string $selectedObjects[] = `ls -sl -o`;&lt;BR /&gt;string $nSelectedObjects = size($selectedObjects);&lt;BR /&gt;&lt;BR /&gt;if (size($selectedObjects) == 1)&lt;BR /&gt;print ($selectedObjects);&lt;BR /&gt;else&lt;BR /&gt;print ($nSelectedObjects);&lt;BR /&gt;&lt;BR /&gt;This is my attempt at making it a global proc. but my syntax must be wrong&lt;BR /&gt;//No of Obj&lt;BR /&gt;global proc string selObj()&lt;BR /&gt;{&lt;BR /&gt;string $SelectedObjects[] = `ls -sl -o`;&lt;BR /&gt;string $nSelectedObjects = size($SelectedObjects);&lt;BR /&gt;&lt;BR /&gt;if (size($SelectedObjects) ==1)&lt;BR /&gt;{&lt;BR /&gt;string $result = ($nSelectedObjects);&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;string $result = ($SelectedObjects);&lt;BR /&gt;}&lt;BR /&gt;return $result;&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Sun, 24 Oct 2021 16:45:01 GMT</pubDate>
    <dc:creator>ajspeed_14</dc:creator>
    <dc:date>2021-10-24T16:45:01Z</dc:date>
    <item>
      <title>HUD Display name of selected object</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/hud-display-name-of-selected-object/m-p/10702617#M3449</link>
      <description>&lt;P&gt;I'm currently using&lt;/P&gt;&lt;P&gt;string $selectedObjects[] = `ls -sl`;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now this works perfectly when a single object is selected, however, once multiple objects are selected it displays the names of each and it ends up covering the viewport.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two ideas and am not quite sure how to implement either of them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Option A. if more than one object is selected it will display 'Multiple'&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;Option B. if more than one object is selected it will display the number&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;suggestions for either would be most appreciated&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 23:13:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/hud-display-name-of-selected-object/m-p/10702617#M3449</guid>
      <dc:creator>ajspeed_14</dc:creator>
      <dc:date>2021-10-20T23:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: HUD Display name of selected object</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/hud-display-name-of-selected-object/m-p/10710149#M3450</link>
      <description>&lt;P&gt;So I've got it to print the correct result in the script editor&lt;BR /&gt;&lt;BR /&gt;But still trying to figure out how to make it work inside a global proc so it can be displayed in the HUD&lt;BR /&gt;&lt;BR /&gt;string $selectedObjects[] = `ls -sl -o`;&lt;BR /&gt;string $nSelectedObjects = size($selectedObjects);&lt;BR /&gt;&lt;BR /&gt;if (size($selectedObjects) == 1)&lt;BR /&gt;print ($selectedObjects);&lt;BR /&gt;else&lt;BR /&gt;print ($nSelectedObjects);&lt;BR /&gt;&lt;BR /&gt;This is my attempt at making it a global proc. but my syntax must be wrong&lt;BR /&gt;//No of Obj&lt;BR /&gt;global proc string selObj()&lt;BR /&gt;{&lt;BR /&gt;string $SelectedObjects[] = `ls -sl -o`;&lt;BR /&gt;string $nSelectedObjects = size($SelectedObjects);&lt;BR /&gt;&lt;BR /&gt;if (size($SelectedObjects) ==1)&lt;BR /&gt;{&lt;BR /&gt;string $result = ($nSelectedObjects);&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;string $result = ($SelectedObjects);&lt;BR /&gt;}&lt;BR /&gt;return $result;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Sun, 24 Oct 2021 16:45:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/hud-display-name-of-selected-object/m-p/10710149#M3450</guid>
      <dc:creator>ajspeed_14</dc:creator>
      <dc:date>2021-10-24T16:45:01Z</dc:date>
    </item>
  </channel>
</rss>

