Results 1 to 1 of 1

Thread: HowTo delete VMAP without removing points

  1. #1
    Registered User
    Join Date
    May 2017
    Location
    Lampertheim, Germany
    Posts
    126

    HowTo delete VMAP without removing points

    Some time ago I encountered a Problem with VMaps that where not removed on "Close All".

    The VMaps are not listed in the Modelers Dropdown for VMaps, but if you browse the VMaps, they will be listed. Because there sare no Points or Polygons after a "Close All", you can't empty the VMap by removing all Points in it (no pointID left), I searched for a possibility to remove them anyway.

    Here is how I was able to do this:

    Code:
    def delete_all_vmaps(type):     # tested with lwsdk.LWVMAP_TXUV
        names=[]
        idx=lwsdk.LWObjectFuncs().numVMaps(type)
        for i in range(0,idx):
            name=lwsdk.LWObjectFuncs().vmapName(type,i)
            names.append(name)
        for i in range(0,idx):  # to not destroy the index-list, a separat for loop is required
            print names[i]
            mesh_edit_op=cmop.editBegin(0, 0, lwsdk.OPSEL_USER)    # cmop=mod_command
            vmid=mesh_edit_op.vMapSelect(mesh_edit_op.state,names[i],lwsdk.LWVMAP_TXUV,2)
            if vmid!=None:
                mesh_edit_op.vMapRemove(mesh_edit_op.state)
                print "removed"
            mesh_edit_op.done(mesh_edit_op.state, lwsdk.EDERR_NONE, 0)
    I did not test this with other maps than UV-Texture, but it should function with every type.

    Regards,
    KANUSO
    Last edited by KANUSO; 04-22-2018 at 02:48 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •