Hi have a simple Object-Plugin:
-
It creates first a Sweep Nurb
-
then it creates the path spline related to the description parameters
-
it puts this spline under the sweep
-
then it loads a profile spline from an Hyperfile / printing works profile is loaded
-
then it puts this profile under the sweep
-
then the sweep is returned in the GVO
-
everthing is happening in the GVO
Returning in the GVO works, everthing is visible.
When I press MakeEditable in the active document of the node, just the sweep and the path-spline are present but not the profile
It also doesent work when I create a virtual document with the spline-profile and extract it from there
But when I press a button then I can add it to the active document....
I do not understand, because the path spline works , maybe since it is mathmetically created?
If I use just a Osplinerectangel as profile then it works
def GetVirtualObjects(self, op, hh):
dirty = op.CheckCache(hh) or op.IsDirty(c4d.DIRTYFLAGS_DESCRIPTION)
if not dirty:
return op.GetCache(hh)
self.spline = BowSpline(op[c4d.PY_WINDOW_WIDTH], op[c4d.PY_WINDOW_HEIGHT], op[c4d.PY_ARCH_HEIGHT], op[c4d.PY_ARCH_SUBD]).spline.GetClone()
self.frame = c4d.BaseObject(c4d.Osweep)
self.spline.InsertUnder(self.frame)
profile = self.load_profile().GetClone()
profile.InsertUnder(self.frame)
if op[10105]:
self.frame.SetRelPos(c4d.Vector(0, 0, op[10105]))
return self.frame
def load_profile(self):
#c4d.documents.MergeDocument(self.new_doc, f"{path}/res/profile.c4d", c4d.SCENEFILTER_OBJECTS)
patho = os.path.join(path, "res", "profile")
profile = c4d.BaseObject(c4d.Ospline)
c4d.storage.ReadHyperFile(None, profile, patho, 100)
return profile
What I am also not understanding is, when I change the description parameter while dragging it, the sweep gets invisible and just the spline is shown which is changing
For this realtime refresh I just catched the global MSG_DESCRIPTION_POSTSETPARAMETER.
is there another way to refesh it instead of callcommand and the id for redraw, maybe DrawViews()?
def Message(self, node, type, data):
if type == c4d.MSG_DESCRIPTION_POSTSETPARAMETER:
#if data['descid'][0].id == c4d.PY_WINDOW_WIDTH:
c4d.CallCommand(12147)