<?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: Maya2020Python Can't get the number of  mel.eval('uvTkDoGetTexelDensity') in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10448809#M3993</link>
    <description>btw,i have a new quesion now,,, i can query the value of map_size,but i found,optionVar is undoable, queryable, and NOT editable. so if i want change the valuse of ui box, set size as 512 or 1024 ,how can i do ,what commnd should i use? ty!</description>
    <pubDate>Wed, 07 Jul 2021 06:06:09 GMT</pubDate>
    <dc:creator>243202504</dc:creator>
    <dc:date>2021-07-07T06:06:09Z</dc:date>
    <item>
      <title>Maya2020Python Can't get the number of  mel.eval('uvTkDoGetTexelDensity')</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10444433#M3985</link>
      <description>&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;I used Maya’s script editor to write the code, and I encountered a problem in it. I want to get the pixel density of my selected part. This function is available in Maya’s UV toolkit. Click the Get button as shown in the figure below.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;Get a number in the back box, but I don't know how to get this number through code.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;Including me, I can't get the 512 after the Map Size below.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;The code I use is&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;mel.eval('uvTkDoGetTexelDensity')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;当我打印它，我得到没有。也许此功能不会返回值，但会将获得的值给 UI 界面后面的框。&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4 月 1 日， 吉马亚 · 伊金 · 吉亚 · 吉亚 · 吉特 · 吉夫 · 特夫特 · 特瓦特 · 特格特 · 吉夫（三）次次次的"大号"&lt;/P&gt;&lt;P&gt;我使用的代码是&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;mel.eval('uvTkDoGetTexelDensity')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;打印打印可能这个功能没有返回值，而是把得到的值给了UI界面后面的方框里。&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 14:22:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10444433#M3985</guid>
      <dc:creator>243202504</dc:creator>
      <dc:date>2021-07-05T14:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Maya2020Python Can't get the number of  mel.eval('uvTkDoGetTexelDensity')</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10444439#M3986</link>
      <description>&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;There are errors in the Chinese part above, just read English.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 14:25:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10444439#M3986</guid>
      <dc:creator>243202504</dc:creator>
      <dc:date>2021-07-05T14:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Maya2020Python Can't get the number of  mel.eval('uvTkDoGetTexelDensity')</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10444447#M3987</link>
      <description>&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;When I print its value, I get None. Maybe this function will not return a return value, but will give the obtained value to the UI box later.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;I need your help and tell me how to get the average pixel density calculated in the box below.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 14:27:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10444447#M3987</guid>
      <dc:creator>243202504</dc:creator>
      <dc:date>2021-07-05T14:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Maya2020Python Can't get the number of  mel.eval('uvTkDoGetTexelDensity')</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10444781#M3988</link>
      <description>&lt;P&gt;uvTkDoGetTexelDensity is a callback for updating a UI field, it doesn't return a value.&amp;nbsp; It just takes the texture size and calls&amp;nbsp;texGetTexelDensity:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;map_size = cmds.optionVar('polyUVTexelDensityMapSize', q=True)&lt;/P&gt;&lt;P&gt;density = mel.eval('texGetTexelDensity(%i)' % map_size)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;map_size is the texture size set in the options box.&amp;nbsp; The&amp;nbsp;polyUVTexelDensityMapSize optionVar won't exist if the user hasn't used that options box before.&amp;nbsp;&amp;nbsp;texGetTexelDensity will also raise an error if there's no object selected to query density for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 17:13:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10444781#M3988</guid>
      <dc:creator>zewt</dc:creator>
      <dc:date>2021-07-05T17:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: Maya2020Python Can't get the number of  mel.eval('uvTkDoGetTexelDensity')</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10445554#M3989</link>
      <description>&lt;P&gt;Thanks for ur &lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;reply!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;"map_size is the texture size set in the options box. The polyUVTexelDensityMapSize optionVar won't exist if the user hasn't used that options box before."&lt;/P&gt;&lt;P&gt;I don't know how to set texture size, I give a number in 'Map Size:' box (512). script editor raise 'uvTkTexelDensityChangeCB', and then I run&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import maya.cmds as cmds
 
map_size = cmds.optionVar('polyUVTexelDensityMapSize', q=True)
print map_size&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it raise&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Error: Object polyUVTexelDensityMapSize is invalid
# Traceback (most recent call last):
#   File "&amp;lt;maya console&amp;gt;", line 3, in &amp;lt;module&amp;gt;
# TypeError: Object polyUVTexelDensityMapSize is invalid # &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 02:19:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10445554#M3989</guid>
      <dc:creator>243202504</dc:creator>
      <dc:date>2021-07-06T02:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Maya2020Python Can't get the number of  mel.eval('uvTkDoGetTexelDensity')</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10445561#M3990</link>
      <description>&lt;P&gt;ok i found a way ,&lt;/P&gt;&lt;LI-CODE lang="python"&gt;map_size = cmds.optionVar(q='polyUVTexelDensityMapSize')&lt;/LI-CODE&gt;&lt;P&gt;and then i got print 512.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 02:23:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10445561#M3990</guid>
      <dc:creator>243202504</dc:creator>
      <dc:date>2021-07-06T02:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Maya2020Python Can't get the number of  mel.eval('uvTkDoGetTexelDensity')</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10447487#M3991</link>
      <description>&lt;P&gt;FYI, that's just the last-used setting in the options box (and it won't exist if that options box has never been used).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 17:47:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10447487#M3991</guid>
      <dc:creator>zewt</dc:creator>
      <dc:date>2021-07-06T17:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Maya2020Python Can't get the number of  mel.eval('uvTkDoGetTexelDensity')</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10448611#M3992</link>
      <description>&lt;P&gt;yeah,and i create a value,then it will be created.&lt;/P&gt;&lt;P&gt;i use it at my code first line like this&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# coding=utf-8
import maya.cmds as cmds
from maya import mel
from functools import wraps

map_size = cmds.optionVar(q='polyUVTexelDensityMapSize')&lt;/LI-CODE&gt;&lt;P&gt;and then it will be created.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 03:56:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10448611#M3992</guid>
      <dc:creator>243202504</dc:creator>
      <dc:date>2021-07-07T03:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Maya2020Python Can't get the number of  mel.eval('uvTkDoGetTexelDensity')</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10448809#M3993</link>
      <description>btw,i have a new quesion now,,, i can query the value of map_size,but i found,optionVar is undoable, queryable, and NOT editable. so if i want change the valuse of ui box, set size as 512 or 1024 ,how can i do ,what commnd should i use? ty!</description>
      <pubDate>Wed, 07 Jul 2021 06:06:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10448809#M3993</guid>
      <dc:creator>243202504</dc:creator>
      <dc:date>2021-07-07T06:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Maya2020Python Can't get the number of  mel.eval('uvTkDoGetTexelDensity')</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10473463#M3994</link>
      <description>&lt;P&gt;texCalculateTexelDensity&lt;/P&gt;&lt;P&gt;density = mel.eval('texGetTexelDensity(%i)' % map_size)&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;This line of code takes too long. Is there any other way? If I get the vertices of the face, the UV ratio and the texture size to calculate the accuracy, or if I don’t need to call mel, but directly use python to speed it up. This&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;Lines of code take up more than 90% of the time consumed by my entire tool.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;I want to optimize it.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 10:10:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya2020python-can-t-get-the-number-of-mel-eval/m-p/10473463#M3994</guid>
      <dc:creator>243202504</dc:creator>
      <dc:date>2021-07-16T10:10:17Z</dc:date>
    </item>
  </channel>
</rss>

