Maya | Find out the number of polygons in the selected object

import maya.cmds as cmds

for obj in cmds.ls(selection=True):
    shape = cmds.listRelatives(obj, shapes=True, type="mesh")
    if shape:
        poly_num = cmds.polyEvaluate(shape[0], triangle=True)
        print obj, poly_num

Recommended Posts

Maya | Find out the number of polygons in the selected object
Python --Find out number of groups in the regex expression
Find the number of days in a month
How to find the optimal number of clusters in k-means
Find out the apparent width of a string in python
Find out the maximum number of characters in multi-line text stored in a data frame
The meaning of ".object" in Django
Find out the age and number of winnings of prefectural governors nationwide
Just print the selected object in Blender
How to find out the number of CPUs without using the sar command
Output the number of CPU cores in Python
Find the divisor of the value entered in python
Find the solution of the nth-order equation in python
Find out the day of the week with datetime
[Completed version] Try to find out the number of residents in the town from the address list with Python
When the selected object in bpy.context.selected_objects is not returned
Projecet Euler 12 Find the number of divisors without division.
How to get the number of digits in Python
Find out the location of Python class definition files.
Count the number of parameters in the deep learning model
Find out the version of the language you are running
Find out the location of packages installed with pip
Get the size (number of elements) of UnionFind in Python
I used Python to find out about the role choices of the 51 "Yachts" in the world.
Find a guideline for the number of processes / threads to set in the application server
10. Counting the number of lines
Examine the margin of error in the number of deaths from pneumonia
Find the difference in Python
Print the name of the object directly under the object specified in Blender
Analyzing data on the number of corona patients in Japan
Get the number of digits
Count the number of characters in the text on the clipboard on mac
Get the number of specific elements in a python list
[Python] Programming to find the number of a in a character string that repeats a specified number of times.
[Homology] Count the number of holes in data with Python
Get the number of occurrences for each element in the list
Calculate the number of changes
Find out how many each character is in the string.
Find the average / standard deviation of the brightness values in the image
Find the eigenvalues of a real symmetric matrix in Python
I tried to find the trend of the number of ships in Tokyo Bay from satellite images.
Count the number of Thai and Arabic characters well in Python
How to know the internal structure of an object in Python
[Cloudian # 9] Try to display the metadata of the object in Python (boto3)
[Python] Let's reduce the number of elements in the result in set operations
Find out the mystery change of Pokédex description by Levenshtein distance
Find the rank of a matrix in the XOR world (rank of a matrix on F2)
Get the number of readers of a treatise on Mendeley in Python
Find the definition of the value of errno
Get the number of views of Qiita
The story of participating in AtCoder
Calculation of the number of Klamer correlations
Get the attributes of an object
The story of the "hole" in the file
Touch the object of the neural network
Get the number of Youtube subscribers
Graph of the history of the number of layers of deep learning and the change in accuracy
Generate a list packed with the number of days in the current month.
Check the in-memory bytes of a floating point number float in Python
[Python] Calculate the number of digits required when filling in 0s [Note]
Graph the change in the number of keyword appearances per month using pandas