Hello,
I would like to add autorotate behaviour to my custom object in Vectorworks. This billboard effect rotates the object around the up-axis to always face the object towards the camera like the build-in Image Prop. https://app-help.vectorworks.net/2020/eng/index.htm#t=VW2020_Guide%2FTextures%2FCreating_image_prop_objects.htm
A solution would be to create an ImageProp and attach the geometry inside it. I use a VWMeshCreator to pass the constructed mesh to Vectorworks.
EObjectEvent XXX_EventSink::Recalculate()
{
VWParametricObj paramObj(fhObject);
MCObjectHandle mcObject = gSDK->CreateImageProp(
/*const TXString& propName*/ TXString("propName"),
/*InternalIndex textureRef,*/ 0,
/*WorldCoord height,*/ 100,
/*WorldCoord width,*/ 100,
/*bool enforceImageAspectRatio,*/ false,
/*bool crossedPlanes,*/ false,
/*bool createPlugin,*/ true,
/*bool autoRotate,*/ true,
/*bool createSymbol*/ true);
gSDK->AddObjectToContainer(mcObject, fhObject);
VWMeshCreator meshCreator;
[...]
const TMCObjectHandlesSTLArray& mcObjectArray = meshCreator.GetGeneratedMeshes();
gSDK->AddObjectToContainer(mcObjectArray[0], mcObject);
}
My question is why is the ImageProp not created and the geometry rotating?
I am new to Vectorworks and spend some days to read through the docs and SDK.
Kind Regards,
Chris