Posts

Showing posts from May, 2020

bpy: Save/Load selection and transform of selected objects

Image
i3d pyc files 1. Download and move i3d.pyc file to Blender’s \scripts\modules\ folder. If you are not sure, print(pby) to print find __int__.py location in modules folder. 2. Save all other i3d_***pyc files to below directory. ~Documents\blender\i3d\scripts\ i3d_GUITools.pyc i3d_selection.pyc i3d_transform.pyc i3d_utility.pyc Commands(in blender) Save&Load current selection[Green] and Save&Load transform(RTXYZ)[Yellow] Commands: import i3d,i3d_GUITools as iGU;

bpy: Getting selected polygon vertices

I've been Maya artist for quite a long time and started to learn how to get infos I need for the i3d tools in Blender. I will try to leave a note for those Maya script artists learning python scripting in Blender 2.8x. ;) def gettingSelectedPolyVertsInMayaFormat(): import bpy; selectedVerts= []; mode = bpy.context.active_object.mode; # Getting current mode bpy.ops.object.mode_set(mode='OBJECT'); # Setting object mode to get selected objects objs= bpy.context.selected_objects # Current selected objects for obj in objs: # Finding selected vertices of the selected  if obj.type=="MESH": # if the object is polygon..   verts= obj.data.vertices; # get all poly verts of the poly object num= len(verts);  for i in range(0,num):   if verts[i].select: # if the vtx is selected..   mayaVTX= obj.name+".vtx["+str(i)+"]"; # Getting selected vtx in Maya format selectedVerts.append(mayaVTX);   bpy.ops.object.mode_set...