Can I lock points or polygons?


#1

I’m new to Cinema 4D (just migrated from 3DS Max) and can’t seem to find how to lock points or polygons in place.

Say for instance I have a plane where I want the edges to stay in the same place no matter what i do to the rest of the mesh. How do I make them stay? I’ve searched both the manual and Internet without any luck and hope that any of you can help a noob out…

Kind regards
Fredrik


#2

There’s no direct way to do that in Cinema, AFAIK. One thing you can do in point mode is select the points and hide them, but that won’t prevent movement in edge or poly mode.


#3

Thank you Adam!

I’ll just have to make do without that then…


#4

You can do that very easy if you have access to the Character stuff inside C4D.

Select your points to be fixed, go to Character -> Commands and click “Set Cluster” Now you’ll
have a cluster object beneath your object and a null, which the selected points are tied to.
This Null can be prevented from moving by giving it a protection tag.


#5

Like Adam said you can’t but there is a trick. You will use the CorrectionDeformer to modify the mesh.
-Make a selection tag for the points on the object you don’t want to move.
-Ctrl click on the Edges Icon in the menu to make an edge selection out of those points. Invert the edge selection and create a selecton tag for it.
-Give your object a CorrectionDeformer.
-Give the CorrectionDeformer a Restriction tag.
-Drag and drop the PointSelection tag in a link field of the Restriction tag.

In principle it’s already working, the points are locked but you will still see the edges move around and that’s distracting.

Drag the edge selection tag from your object to the CorrectionDeformer and hide the edges.


#6

The points can still be manipulated with the Magnet tool or Brush tool


#7

Question though…
You mean lock them while you’re modeling, or lock them while animating?

If it’s just for modeling, the dirty way would be to temporarily hide them so they can’t be modified. (While points are selected in point mode, go to the main menu, Select>HideSelected).
You will still see the polys and edges connected to it, but the points themselves will be locked until you unhide them.

If you want to lock them for animation, Clusters or Joints with Weights are your option. You could also do it with COFFEE/Python/XPresso, though it’s extremely messy.


#8

It’s not that complex as a script. Here’s something I quickly knocked up in Python that should do it (I’ve not thoroughly tested it but I don’t see much of a reason that it shouldn’t work).

#Python tag to lock points in place from a selection tag
 
 import c4d
 from array import *
 #Welcome to the world of Python
 
 seldirty = 0
 lastsel = None
 points = []
 
 def main():
 	global seldirty
 	global lastsel
 	global points
 	
 	i = 0
 	obj = op.GetObject()
 	if not obj.CheckType(c4d.Opoint):
 		return False
 	
 	seltag = op[c4d.ID_USERDATA,1]
 	if seltag == None or not seltag.CheckType(c4d.Tpointselection):
 		return False
 	
 	sel = seltag.GetBaseSelect()
 	if sel == None:
 		return False;
 	
 	pcnt = obj.GetPointCount()
 	padr = obj.GetAllPoints()
 	if padr == None:
 		return False;
 	
 	#Selection remains the same as before no point in updating
 	if seltag != lastsel or seldirty != sel.GetDirty():	
 		points = []
 		for index, selected in enumerate(sel.GetAll(pcnt)):
 			if not selected: continue
 			points.append(padr[index])
 		lastsel = seltag
 		seldirty = sel.GetDirty()
 	
 	for index, selected in enumerate(sel.GetAll(pcnt)):
 		if not selected: continue
 		padr[index] = points[i]
 		i = i + 1
 	
 	obj.SetAllPoints(padr)
 	obj.Message(c4d.MSG_UPDATE)
 	
 	
 	pass  #put in your code here
 

Just make a python tag on your object, slap that in there, add a link on the python tag using the user data editor, and then drag & drop in a selection tag with the points you want to lock into that link field. That’ll work for both modeling and animating. You can then add it to your library so you can use it wherever you need.


#9

Oh and of course to modify it for polygons should be trivial too, you could even have a single tag do both with minimal effort.


#10

Wow! Thank you all very much!

My original question was for modeling, but it’s nice to know how to do it for animation as well!


#11

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.