Wednesday
Hi,
Does anybody know if it is possible to refresh the 3D view after positioning the camera? If I set the camera from my addon I can do a rebuild, but that can cost a lot in case of having larger models. The redraw feature of the API does not seem to work for this case, so far I did not find any solution just to call rebuild. Sure when I move manually the model there is no rebuild all the time, otherwise the 3d performance would be really bad even on smaller models, not just on large ones.
Thanks!
Wednesday
Hi Gábor,
What do you use to move the camera? Could you post some code snippets?
Thanks,
Tamás
Thursday
Hi,
Basicalliy we use ACAPI_View_Change3DProjectionSets. Something sure happens, because after the API call if I manually rotate the model slightly, then suddenly the view jumps where it should have been after the API call. If we call ACAPI_View_Rebuild actually it works, just rebuilding large models is not the best, ACAPI_View_Redraw does not seem to do anything. Actually if I do not change the view manually, I just try to place a column for example, then it goes in the model where I clicked. So the repositioning really happens after I manually adjust something regarding the camera or view options like switching from shaded to wireframe or something like that.
Please let us know if there is another function we can use for setting the camera.
yesterday
Hi,
I made some experiment in the addon. So the full flow is that the addon gets a message from a different scope (at this point the focus is not necessarily on AC). As part of processing the message we try to adjust the camera with ACAPI_View_Change3DProjectionSets. We tried to have it as it is, also tried to redraw, the only thing helped so far is rebuild.
We tried to use timer based approach, directly calling the function, we tried playing with ACAPI_AddOnAddOnCommunication_CallFromEventLoop considering that maybe AC does not like this externally initialized navigation, so far without success. All 3 approach work with rebuild in a stable way, and none of them works with redraw.
If I move the mouse on the 3d view, elements are highlighted like they are shown, or I can place things in the plan based on the shown view, but in the very moment I move the mouse wheel, or drag the plan slightly away, the view immediately updates exactly how we would expect after calling ACAPI_View_Change3DProjectionSets.
Do we miss something? I'll try to isolate the problem and just add a button for debugging to see if the problem is somehow related to the communication module.
yesterday
If I create a button, and have this in place it still does not seem to work until I zoom or move a little, then it jumps to the right place. The whole thing could have been in the button callback, just now I did not care about that so much.
virtual void ButtonClicked (const DG::ButtonClickEvent& ev) override
{
if (ev.GetSource () != &rotateButton) return;
const GSErrCode err = Camera::RotateRight10 ();
}
static GSErrCode RotateRight10 ()
{
API_3DProjectionInfo proj;
if (!ReadProjection (proj)) return APIERR_GENERAL;
SetRotation (proj);
return ACAPI_View_Change3DProjectionSets (&proj);
}
I also tried with modal window instead of a palette.
The result in all cases that rebuild is required.