# - a test on mesh parity between getraw and getrawfromobject
# when there is active subsurf division.
# - can copy, or not, vertex groups from the original mesh.
#---------------------------------------------
importBlender
fromBlenderimportNMesh,Draw,Object
defrvk2rvk():
try:
SUBMODIF=0
RVK2=Object.GetSelected()[0]
RVK1=Object.GetSelected()[1]
FRAME=Blender.Get('curframe')
DATA2=RVK2.getData()
ifDATA2.getMode()&NMesh.Modes['SUBSURF']:
SUBSURF2=DATA2.getSubDivLevels()
ifSUBSURF2[0]!=0:
name="The active object has a subsurf level different from 0 ... %t| Let script do the the modification for you ? %x1| you prefer do it yourself ? %x2 "
result=Draw.PupMenu(name)
ifresult==1:
DATA2.mode=DATA2.mode-NMesh.Modes['SUBSURF']
SUBMODIF=1
DATA2.update()
RVK2.makeDisplayList()
Blender.Redraw()
else:
return
RVK2NAME=Object.GetSelected()[0].getName()
mesh=RVK1.getData()
meshrvk2=NMesh.GetRawFromObject(RVK2NAME)
name="Do you want to replace or add vertex groups ? %t| YES %x1| NO ? %x2 "