python blender-groups-by-vert-count.py

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python blender-groups-by-vert-count.py相关的知识,希望对你有一定的参考价值。

import bpy

data = {}
for obj in bpy.data.objects: # bpy.context.selected_objects
    if obj.type == 'MESH':
        data.setdefault(len(obj.data.vertices), []).append(obj)
    
for key, value in data.items():
    group_name = "{} Vertices".format(key)
    
    if group_name not in bpy.data.groups:
        bpy.ops.group.create(name=group_name)
        
    grp = bpy.data.groups.get(group_name)
    for obj in value:
        if len(obj.users_group) == 0:
            grp.objects.link(obj)

以上是关于python blender-groups-by-vert-count.py的主要内容,如果未能解决你的问题,请参考以下文章

Python代写,Python作业代写,代写Python,代做Python

Python开发

Python,python,python

Python 介绍

Python学习之认识python

python初识