Hi all, i'm trying to generate an XRAY pyramid inside the GetVirtualObjects() without luck.
Here my source code:
BaseObject* pyramid = BaseObject::Alloc(Ocone);
if (pyramid) {
BaseContainer* cone_bc = pyramid->GetDataInstance();
const Float pyra_height = 0.75;
const Vector v1 = Vector(0.0, 1.0, 0.0);
const Vector v2 = Vector(1.0, 0.0, 0.0);
const Vector v3 = Vector(0.0, 0.0, 1.0);
const Vector center = bot_pos + Vector(0.0, pyra_height, 0.0);
const Matrix mg = Matrix(center, v2, v1, v3);
pyramid->SetMg(mg);
cone_bc->SetFloat(PRIM_CONE_TRAD, mid_lower * supp_scale);
cone_bc->SetFloat(PRIM_CONE_BRAD, mid_lower * 2.0 * supp_scale);
cone_bc->SetFloat(PRIM_CONE_HEIGHT, pyra_height);
cone_bc->SetFloat(PRIM_CONE_HSUB, 1);
cone_bc->SetFloat(PRIM_CONE_SEG, subdivision);
cone_bc->SetBool(PRIM_CONE_CAPS, true);
cone_bc->SetInt32(PRIM_CONE_CSUB, 1);
cone_bc->SetInt32(PRIM_CONE_FSUB, fstep);
// Try to set Xray ---------------------------
ObjectColorProperties prop;
pyramid->GetColorProperties(&prop);
prop.xray = true;
pyramid->SetColorProperties(&prop);
pyramid->SetParameter(ID_BASEOBJECT_XRAY, GeData(TRUE), DESCFLAGS_SET_0);
pyramid->Message(MSG_UPDATE);
// Try also with Container -------------------
cone_bc->SetBool(ID_BASEOBJECT_XRAY, true);
doc->InsertObject(pyramid, ret, nullptr);
}
Thanks in advance
Renato T.