[Bf-cycles] Cannot update object transform

F Escobar materialesescobar at hotmail.es
Fri Feb 2 14:18:51 CET 2018


Thank you unfortunatly I'm getting undesired behaviour.

newTfm is my desired global tranform.

I've tried
sceneObjects[index]->tfm = newTfm;
sceneObjects[index]->tag_update(scene);
sceneObjects[index]->apply_transform(false); //this seems to be mandatory!
and
Transform ioldTrans = transform_quick_inverse(sceneObjects[index]->tfm);
sceneObjects[index]->tfm = ioldTrans * newTfm;
sceneObjects[index]->tag_update(scene);
sceneObjects[index]->apply_transform(false); //this seems to be mandatory!

But no one worked for me also sometimes it generates shading glitches on the meshes asociated to that object.


Regards and thanks for your valuable help, F.



________________________________
De: Bf-cycles <bf-cycles-bounces at blender.org> en nombre de Brecht Van Lommel <brechtvanlommel at pandora.be>
Enviado: viernes, 2 de febrero de 2018 13:20
Para: Discussion list to assist Cycles render engine developers
Asunto: Re: [Bf-cycles] Cannot update object transform

Hi,

Use this:

sceneObjects[index]->tag_update(scene);

In general, scene updates can be done like this:

scene->mutex.lock()
... modify scene and call tag_update() ...
scene->mutex.unlock()

if(scene->need_reset()) {
    session->reset(...)
}

Regards,
Brecht.

On Fri, Feb 2, 2018 at 12:59 PM, F Escobar <materialesescobar at hotmail.es<mailto:materialesescobar at hotmail.es>> wrote:
I'm playing with Cycles standalone in interactive mode.

I've added some custom objects via code to the scene, but now I wanna to move them and I didn't found any way.

Obviosly I start setting their transform with
sceneObjects[index]->tfm =newTfm; //tested that they are not the same transform.

Also I tried several functions that sound promising but without luck:
sceneObjects[index]->apply_transform(true);
scene->mesh_manager->need_update = true;
options.scene->params.bvh_type = SceneParams::BVH_DYNAMIC;
options.session->update_scene();
options.session->reset(session_buffer_params(), options.session_params.samples);

Anyone could give me a tip?

Thank you in advance.


_______________________________________________
Bf-cycles mailing list
Bf-cycles at blender.org<mailto:Bf-cycles at blender.org>
https://lists.blender.org/mailman/listinfo/bf-cycles


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-cycles/attachments/20180202/3e862343/attachment.html>


More information about the Bf-cycles mailing list