Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hi @Manuel , Sorry for asking a question that has already been resolved in another thread. That thread solved my question. Thank you.
Hi,
I tried to get the weight values from a Vertex Map tag in the documented way. It workd for editable polygon objects, but not for uneditable obejcts.
The .c4d file: VertexMapWeightsFromUneditableObjects.c4d
The code:
import c4d def main(): tag = op.GetFirstTag() weight = tag.GetAllHighlevelData() print(weight) if __name__ == '__main__': main()
The result for uneditalble cube:
Traceback (most recent call last): File "scriptmanager", line 9, in <module> File "scriptmanager", line 5, in main SystemError: <method 'GetAllHighlevelData' of 'c4d.VariableTag' objects> returned NULL without setting an error
The result for editalble cube:
[0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0]
Is there any way to get the weight values for uneditable objects? Thank you.
Hi @ferdinand,
So the normal direction of the generated polygons was the point! Thank you for answering my curiosity and explaining how to reproduce the behavior.
Out of curiosity, I would like to know under what conditions the inner segment of a spline behaves as a hole. If possible, I would like to reproduce this behavior in Python Generator. Any hints would be appreciated.
Thank you for the detailed explanation and the code. It works perfectly and the problem is solved!
The scene file: GetKeyframesInMotionSystemLeyers.c4d
The Motion System tag on the cube object has 2 Layers (Layer 0 and Layer 1). Layer 0 has 2 keyframes in Position . X track. Layer 1 has 3 keyframes in Position . Y track.
Layer 0
Layer 1
After selecting the Cube object, run the following script.
import c4d def main(): # Print the name of track and the number of keyframes for each track tracks = op.GetCTracks() for track in tracks: curve = track.GetCurve() key_count = curve.GetKeyCount() print(track.GetName()) print(key_count) if __name__ == '__main__': main()
The result:
Position . X 1 Position . Y 1
I tried to access to keyframes that are attached to layers of Motion System tag, but it seems not possible. Those methods used to get keyframe such as GetTracks() and GetKeyCount() only return values for Default Layer of the Motion System tag. Is there any way to get correct information of keyframes on Motion Manager layers? Thank you.
I expected there to be a way to know which particle referred to which original geometry, but I didn't know how, so thanks. I should have looked more closely at the documentation. Moreover, I didn't think it could handle blended cloners.
Anyway, thank you very much. Problem solved.
Thank you for your quick answer. That makes sence. I am not sure I should continue in this thread or should open a new one, but I would like to ask about the way to access the actual size of clones.
I am trying to create a system of stacking cubes whose scale animates, and I need to get the size of each clone to do so. Currently, the size of each clone is obtained by caching the cloner, but this causes processing delays and animation problems.
The preview: https://drive.google.com/file/d/1G91Hx__2xZ_ZJhK3EJJEtF82sCc38Z9f/view?usp=sharing
The scene file: StackingCubes_ProcessingDelayIssue.c4d
The Python Effector code:
import c4d def main(): moData = c4d.modules.mograph.GeGetMoData(op) marr = moData.GetArray(c4d.MODATA_MATRIX) cloner = moData.GetGenerator() cached = cloner.GetCache() cubes = cached.GetChildren() pos_y = 0 for i, cube in enumerate(cubes): height = cube.GetRad().y*2 * cube.GetMg().GetScale().y pos_y += height / 2 marr[i].off = c4d.Vector(0, pos_y, 0) pos_y += height / 2 moData.SetArray(c4d.MODATA_MATRIX, marr, False) return True
Is there any way to get the size of clones without processing delay? Any advice or examples similar to this topic would be appreciated. Thank you.
I tried to get the sizes of clones with MoData.GetArray(c4d.MODATA_SIZE), but it returns None where the other IDs (e.g. c4d.MODATA_MATRIX) works fine.
MoData.GetArray(c4d.MODATA_SIZE)
c4d.MODATA_MATRIX
Is this an issue or am I doing something wrong? Any advice would be appreciated.