Getting Take override
-
On 05/12/2016 at 06:50, xxxxxxxx wrote:
Hi, I would to know if there is a method to get the take ovverides from a given Baselist2d?
Previously(at least from R17) developper from vray for c4d have put their object wich are used for multi-pass into Motion. So with GetNLARoot() and after with some GetDown / GetNext we can finally read the pass and modify them...
mpSceneHook = doc.FindSceneHook(1028268) motion = mpSceneHook.GetNLARoot()
But since the R17 all pass informations are into the Take Overrides (wich look like they put all their nodes into the last track and not into the track they created called VrayMpSH.....)
So is there a way to get the Take Overrides base node?
Here is a picture of the documents. Maybe it will make more sense than my ugly english.
http://img11.hostingpics.net/pics/391251GetTake.jpgThanks in advance !
-
On 06/12/2016 at 02:00, xxxxxxxx wrote:
Hi,
you could use for example BaseTake.FindOverride().
Please also take a look at the general Take System API documentation for information on all related classes.
Also the Python SDK examples on the Take System might help.And finally the C++ Docs contain manuals about the Take System, which adds additional information on how the Take System classes are related. So this might be a good read for Python developers as well.
Edit: Please, avoid possible insults to other developers. I'd be astonished, if you hadn't made bad development decisions in the past as well (not implying the vray for c4d devs did so).
-
On 06/12/2016 at 03:40, xxxxxxxx wrote:
Thanks you Andreas ! C++ doc about take is really nice.
I understand the concept of take way more better now.Using the following code in C4d make it crash (tested on R17.055 and R18.028)
import c4d def main() : takeData = doc.GetTakeData() if not takeData: return baseTake = takeData.GetMainTake() if not baseTake: return mpSceneHook = doc.FindSceneHook(1028268) if not mpSceneHook: return overideTake = baseTake.FindOverride(takeData, mpSceneHook) #Crash here print overideTake if __name__=='__main__': main()
I guess it's not usuable into a BaseList2D which herit from a scene hook since it's working fine on an object.
Anyway my apology about my frustation yesterday... Was tired of my dailies crash with vray. But you was right !
-
On 07/12/2016 at 10:39, xxxxxxxx wrote:
Unfortunately I have no Vray here, so I can't test with the exact same scenehook.
But here I tried several of our own internal scenehooks and I wasn't able to crash C4D using your code.
So this is probably something best discussed with the developers of the Vray bridge. -
On 07/12/2016 at 11:38, xxxxxxxx wrote:
Another thing. I tested with the last beta of vray. data are strctured exactly in hte same way. But this time the code above didn't crash. Just return None (even if data are in the group).
But if I try print mpSceneHook.GetName() or anyotherthing related to a baseList2D node it crashing.
So I guess it's more an issue from vray than from c4d ! As you said gonna contact them !Thanks for reply.
-
On 08/12/2016 at 01:18, xxxxxxxx wrote:
The situation is a bit worse by the way. The BaseList2D with the take overrides are located in a branch of the SceneHook. And while it is already not recommended to use GetBranchInfo() in C++ to get hold of these, in Python GetBranchInfo() is simply not available.
The recommended way of accessing entities in a branch of a SceneHook would be dedicated library calls, provided by the creator of the SceneHook. So maybe you also want to ask the vray developers for such an API. -
On 08/12/2016 at 01:37, xxxxxxxx wrote:
I contacted the vray just this morning. Gonna add your informations.
But I think it will be quicker to port my plugin to C++. (And also a good practrise to learn C++ :))
I will make some test with GetBranchInfo().Anyway thanks for keep searching on the problem !
-
On 08/12/2016 at 01:47, xxxxxxxx wrote:
As I said, using GetBranchInfo() is also not the recommended way, as it somehow breaks the encapsulation of the SceneHook, it's just a hacky workaround. The proper way is really an API providing access to the "branch children" of the SceneHook.
I have to say this, as you can break a lot of stuff, doing the wrong things with the information retrieved from GetBranchInfo().