THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 14/03/2012 at 06:33, xxxxxxxx wrote:
Hi to everyone,
I'm trying to write a simple script that converts ringselections in points by melting the selected points.
In order to get an automatism I only select the first point, and python get the next neighbors by calling SendModelingCommand(c4d.MCOMMAND_SELECTGROW...).
Works how suggested up to this point.
Now the problem: because I need to keep the sourcepoint of every new ringselection I've tried to deselect the first point so I can melt the remaining points.
But I can't get this working. Either the whole selection disappears or nothing happens.
I've tried to get the BaseSelection.DeselectFrom(x) function working for me, but no success.
Here the code I'm using:
> def meltNextRing(doc,scriptParent) :
> source = scriptParent[c4d.ID_USERDATA,2] #the object to work on
> doc.SetSelection(source,c4d.SELECTION_NEW)
>
> sourcePoint = source.GetPointS() #get first point
>
> settings = c4d.BaseContainer()
> v = utils.SendModelingCommand(c4d.MCOMMAND_SELECTGROW,[source],c4d.MODELINGCOMMANDMODE_POINTSELECTION,settings,doc)
> scriptParent.Message(c4d.MSG_UPDATE)
>
> newSelection = source.GetPointS()
> newSelection.DeselectFrom(sourcePoint)
>
Any suggestions?
Best regards,
blutsvente