Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search

Issue with cache generated by Voronoi

Author
Message
  Topic Search Topic Search
peterakos View Drop Down
Member
Member


Joined: 2015 Jul 13
Online Status: Offline
Posts: 349
Direct Link To This Post Topic: Issue with cache generated by Voronoi
    Posted: 2018 Jan 12 at 6:36am

User Information:

Cinema 4D Version:   R18 
Platform:   Windows  ;   
Language(s):     C++  ;   

---------

Hello.

I face a cache generation issue in the following example.

I have a voronoi, which fractures an object using a matrix mograph as source.
The matrix mograph generates 2 points, so the object breaks in half.

I also use a Plain effector that hides one of those 2 parts of the voronoi (by using scale -1).
To do that, I have placed a Mograph Selection on the Voronoi.

The problem is that if I place the voronoi above matrix, I get wrong Cache from the voronoi.
If the Voronoi is placed below Matrix, I get the correct cache.

Why is this happening ?
As document, I use GetActiveDocument().

Thank you.


Edited by peterakos - 2018 Jan 12 at 6:44am
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1878
Direct Link To This Post Posted: 2018 Jan 15 at 8:25am
Hi,

my first guess is a priority issue in the scene. Whenever reordering of objects in the OM remedies an issues, that's something to take into account. So check and play around with the priorities of objects in concern. Please also see the documentation in our user help on this topic.

If the above does not solve the issue, could you maybe provide us with a test scene and more importantly a more detailed description of when and where you are encountering these issues. Plugin type? In which function are you trying to retrieve the cache? ...

Cheers,
Andreas
SDK Support Engineer
Back to Top
peterakos View Drop Down
Member
Member


Joined: 2015 Jul 13
Online Status: Offline
Posts: 349
Direct Link To This Post Posted: 2018 Jan 16 at 1:34am
Hello and thank you for your help.

In my initial post I made a mistake.

The scene doesn't work only if I clone the GetActiveDocument(). 
If I use directly GetActiveDocument() without cloning it, it gives me the correct cache.
Also, the cache I get from the vps->doc in VideoPost's Execute(...) works correctly. 
So, It appears I do something wrong in cloning the active document.

This is how I do it (code is minimized):
clone_doc = (BaseDocument*)GetActiveDocument()->GetClone( COPYFLAGS_DOCUMENT | COPYFLAGS_NO_MATERIALPREVIEW , NULL);
clone_doc->ExecutePasses(render_thread, TRUE, TRUE, TRUE, BUILDFLAGS_EXTERNALRENDERER);

How should I clone the doc so the OM reordering shouldn't affect the result ?

Thank you !



Edited by peterakos - 2018 Feb 05 at 12:14am
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1878
Direct Link To This Post Posted: 2018 Jan 17 at 5:58am
Hi,

first of all, while probably not related to your issue, you are using GetActiveDocument() in a VideoPost plugin. That's really not a good idea.
Always remember the rule: Never use the active document in a NodeData derived plugin.

Then can you please try to call ExecutePasses() twice or even three times and see if it makes a difference?

Lastly, if there's no change on your end, please provide us with the scene, so we can have a closer look.


Cheers,
Andreas
SDK Support Engineer
Back to Top
peterakos View Drop Down
Member
Member


Joined: 2015 Jul 13
Online Status: Offline
Posts: 349
Direct Link To This Post Posted: 2018 Jan 17 at 6:12am
Hello.

Inside VideoPost's Execute(...) I use only vps->doc.
But, since I have to use the document to start a non-videopost rendering, my only choice is GetActiveDocument (right ?).

By calling ExecutePasses twice I get the correct result !
How can I know how many times should I call it ?

Thank you very much for your help Andreas !
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1878
Direct Link To This Post Posted: 2018 Feb 01 at 9:28am
Hi,

sorry for having you wait so long. Unfortunately I need to ask for more patience. I'm still in need for some feedback from development.

Cheers,
Andreas
SDK Support Engineer
Back to Top

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.094 seconds.