Convert a soft selection to a vertex map


#1

Is this possible?


#2

Mitchino,

there’s an older plugin (written in C, I believe) which will do it: Softvmap v1.2 works in R17 but not in R20, even with the Bridge.

Unfortunately, it’s hard to find these days, I couldn’t track it down with google.

Hope that helps a little, maybe someone else knows a little more about the developer.

P


#3

addendum: Bret Bays wrote a script in 2017 which will do the same, you might be able to contact him for a copy:


#4

This seems to work okay:

import c4d

def main():
    tags = op.GetTags()
    stag = None

    for tag in tags:
        if tag.CheckType(c4d.Tsoftselection):
            stag = tag

    if stag is None: return

    vtag = c4d.VariableTag(c4d.Tvertexmap, op.GetPointCount())
    if vtag is None: return

    data = stag.GetAllHighlevelData()
    vtag.SetAllHighlevelData(data)
    op.InsertTag(vtag)

    c4d.EventAdd()

if __name__=='__main__':
    main()

#5

Thanks very much peeps


#6

Nicely done, Darter, thanks!


#7

One question , is that code possible to put into a button?


#8

Go to the Script Manager (Shift+F11), paste the Python code above and choose File>Save and choose a script name. It should save to your default script directory but will depend on your preferences.

You can now add that icon as you do any other script to your interface.

By default it will use a generic Icon. If you want a custom icon, create a .TIF file (32px x 32px) with the icon you want, name it exactly the same as your script name (not the extension) and place in into the same folder as your Python Script (/scripts folder) and in the Script Manager choose File>Load Icon…


#9

…or directly create some nice image in viewport and render to icon…


#10

Thanks


#11

I know the dancing is done here…but honestly…Why does this thread exist? And why such a script?

Vertex Maps are easy to create, modify and soften if one wishes…while soft selections frankly in c4d are pretty lame (they don’t radiate out from the true selection boundary but always from a center point).

On top of that you can use a vertex map as a falloff just as you can a soft selection. It’s more accurate. So…what’s the point?

Just curious.


#12

I asked the original question because I was experimenting with Octane Scatter, which can be controlled with a vertex map, but not a poly or point selection tag. I find it easier to create poly and point selections than vertex maps, hence the request for a convertor.

I admit I don’t fully understand how to create good vertex maps - can you direct me to a tutorial that shows me the best way to create vertex maps? They always look rough and lo-res when I paint them on.


#13

They cannot be higher resolved than the point density, obviously. Anything in between is interpolated - but that is the same for soft selections (as you see in the script, even the data structure of the tag is the same!)

Is it possible that you always paint the vertex maps at 100%? Or don’t use the various brushes? (Smoothing should get you the same results as a soft selection)