-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Zaher Dirkey edited this page May 3, 2024
·
4 revisions
convex = bpy.context.object.data.attributes['convex']
print(convex.data[4].value)
convex.data[4].value = False
import bpy
import bmesh
obj = bpy.context.object
mesh = bpy.context.object.data
bm = bmesh.from_edit_mesh(mesh)
if "convex2" in bm.faces.layers.int:
layer = bm.faces.layers.int["convex2"]
else:
layer = bm.faces.layers.int.new('convex2')
if layer == None:
print("No Convex")
else:
print(bm.faces[6][layer])
bm.faces[6][layer]=True
obj = bpy.context.object
obj.data.attributes.add(name="myAttributeFloat", type="BOOLEAN", domain="FACE")
obj.data.attributes.remove(name="myAttributeFloat", type="BOOLEAN", domain="FACE")
import bpy
class MyGroup(bpy.types.PropertyGroup):
myItems = []
enums = bpy.props.EnumProperty(name="My Items", items=myItems)
bpy.utils.register_class(MyGroup)
bpy.types.Mesh.my_group = bpy.props.PointerProperty(type=MyGroup)
bpy.context.active_object.data.my_group.myItems.append(100)
bpy.context.active_object.data.my_group.myItems.append(101)
print(bpy.context.active_object.data.my_group.myItems)
import bpy
import bmesh
bm = bmesh.new()
bm.from_mesh(bpy.context.object.data)
for attr in dir(bm.faces.layers):
if attr.startswith('__'):
continue
print(attr, getattr(bm.faces.layers, attr).keys())
print(bpy.context.object.data.attributes.get('z_convex'))
print('z_convex' in bpy.context.object.data.attributes)
attr = bpy.context.object.data.attributes['z_convex']
if attr != None:
bpy.context.object.data.attributes.remove(attr)