File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 66def map_case_name (i ):
77 return ('_' if not i .identifier [0 ].isalpha () else '' ) + i .identifier .replace (' ' , '_' ).upper ()
88
9+ def socket_type_to_data_type (socket_type ):
10+ match socket_type :
11+ case 'VECTOR' :
12+ return 'FLOAT_VECTOR'
13+ case 'COLOR' :
14+ return 'FLOAT_COLOR'
15+ case _:
16+ return socket_type
17+
918# The base class all exposed socket types conform to.
1019class Type :
1120 socket_type : str
@@ -124,6 +133,11 @@ def y(self):
124133 @property
125134 def z (self ):
126135 return self ._get_xyz_component (2 )
136+
137+ def capture (self , value ):
138+ data_type = socket_type_to_data_type (value ._socket .type )
139+ captured = self .capture_attribute (data_type = data_type , value = value )
140+ return captured .geometry .transfer_attribute (data_type = data_type , attribute = captured .attribute )
127141
128142for standard_socket in list (filter (lambda x : 'NodeSocket' in x , dir (bpy .types ))):
129143 name = standard_socket .replace ('NodeSocket' , '' )
You can’t perform that action at this time.
0 commit comments