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

Sculpt Tag changes don't change dirty flags. Why?

 Post Reply Post Reply
Author
Message
Aaron94 View Drop Down
Member
Member


Joined: 2015 Dec 15
Online Status: Offline
Posts: 66
Post Options Post Options   Quote Aaron94 Quote  Post ReplyReply Direct Link To This Post Topic: Sculpt Tag changes don't change dirty flags. Why?
    Posted: 2017 Aug 03 at 9:43am

User Information:

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

---------

Hi C4D,

We have Interactive Preview Render (IPR) mode which relies on dirty flags such as GetHDirty() and GetDirty() that we check for Document. If changes then we look into the hierarchy of objects. If changed (or if the order is changed) then we collect object data and send to IPR. All of this is super fast. 

But! If we attach the Sculpt Tag to some object. Then it doesn't change the values of GetHDirty() or GetDirty(). I have tested all available flags of these functions, document, objects itself, even the tag flags were tested. User changes the object with attached Sculpt Tag in Editor, but dirty flags doesn't change.

How can we automatically detect such changes? We just don't want to enter the level of data content and compare all the polygons one by one. Need flags that work well for other cases.

Best regards,
Aaron
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1430
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Aug 07 at 4:49am
Hi Aaron,

unfortunately there is no dirty flag or anything equivalent in order to detect sculpting changes. Sorry, regarding to development this was a deliberate decision for performance.

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


Joined: 2015 Dec 15
Online Status: Offline
Posts: 66
Post Options Post Options   Quote Aaron94 Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Aug 13 at 5:18am
Hi Andreas, I see. Tested everything. However, let's think about a workaround.
An idea: 
1) Collect links to objects with Sculpt Tags.
2) Detect if user is working with some Sculpt Tool like knife
3) Detect selected object.
4) Force updates on selected/active objects with Sculpt Tags

Question: is it possible to detect #2 item?
Back to Top
gr4ph0s View Drop Down
Member
Member


Joined: 2015 Jul 07
Location: France
Online Status: Offline
Posts: 306
Post Options Post Options   Quote gr4ph0s Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Aug 13 at 8:17am
You can catch it using EVMSG_TOOLCHANGED. Then you just have to get the active doc and get the active tool.

I didn't try but maybe EVMSG_CHANGE will success for detect change.
Technical lover.
Aviable for job in october.
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1430
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Aug 14 at 8:53am
@Aaron: Well, maybe you could (as gr4ph0s already suggested), but I'm afraid you will bog down sculpting performance by doing so. In the end, if I understand correctly, you are suggesting to force those updates, that were avoided in the sculpting pipeline to keep the performance high. So, if you decide to go that route, I recommend to be careful and thorough testing, especially of performance impacts.

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


Joined: 2015 Dec 15
Online Status: Offline
Posts: 66
Post Options Post Options   Quote Aaron94 Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Aug 14 at 11:56am
Andreas, sure you are right. It depends on the size of the object under the sculpt, and how far we can go with optimizations and what can go to background threads. One potential idea is to allow this to work automatically with all this complex coding construction if detect small polycounts. If detect too large polycounts which may slowdown the main activity then show a message attracting to click a button after huge changes.

E.g. is there any chance today to read object polygons in a background thead asynchronously? Potentially inside some critical section. Currently it's possible to do some multi-threaded process with scene launched in Main thread but we need to block it until this multi-threaded process finish the job.
Back to Top
 Post Reply Post Reply

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.102 seconds.