Convert Houdini object to polygon object



  • On 31/07/2017 at 01:20, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   17.055 
    Platform:       Windows 10
    Language(s) :       PYTHON

    ---------
    I'm trying to render an animation using Thea Render. The scene contains a houdini digital asset which creates geometry but thea does not seem to like those houdini objects and does not render them. I created a small script inside a Python Generator which converts a c4d.BaseObject to c4d.PolygonObject:

     _	base = op.GetDown().GetDown().GetClone()_
     _    _
     _    	if not base: return_
     _    _
     _    	obj = c4d.utils.SendModelingCommand(c4d.MCOMMAND_MAKEEDITABLE,_
     _                                        			list=[base],_
     _                                        			bc=c4d.BaseContainer(),_
     _                                        			doc=doc)_
     _    	_ _print obj[0].GetClone()_
     __
     _    	return obj[0].GetClone()_
    

    After running this code on a basic cube in a null as a child of the generator Thea starts rendering a normal cube. As soon as I set the houdini generator as a child and start rendering, a Null object is returned by the python generator and nothing is rendered inside Thea. (The converted object is still visible in the viewport)

    Is there a way to get this running, have I done something wrong or could it be a problem inside of thea render?

    This is my setup:
    https://drive.google.com/file/d/0B_fI3gEuo7tebXJjYWpSXzhPcXc/view?usp=sharing
    _
    _
    Console Output:
    _

    _
     _< c4d.PolygonObject object called 'geo3/file1_0/Polygon-Objekt' with ID 5100 at 0x000002B67E2518F0>_
     _ _
     _------------ Started Document Conversion ------------_
     _< c4d.BaseObject object called 'geo3/file1_0/Null' with ID 5140 at 0x000002B67E34D1D0>_
     _ExecutePasses:  0.855_
     _PrepareConversion:  13.946_
     _Fill Stacks:  0.077_
     _Hierarchy Traversing:  0.022_
     _CloneParentStack:  0.001_
     _Node Creation:  1.09_
     _Conversion:  0.202_
     _Motion Post Process:  0.086_
     _WriteDescription:  0.068_
     _TotalGeometryTransferring:  1.397_
     _PassingEnvironmentInScene:  0.094_
     _
    

    _



  • On 02/08/2017 at 10:11, xxxxxxxx wrote:

    Hi,

    we haven't had time yet to set up a test. So I'm currently guessing. Can you please check, if you get more than one object returned in the list? If that's not the case, can you provide us with your houdini asset for some tests here?
    In the end it's hard to say, if there's something wrong on Thea's side. Maybe it's not evaluating the complete cache hierarchy. But this is something that needs to be discussed with the Thea bridge developers.



  • On 03/08/2017 at 06:47, xxxxxxxx wrote:

    Ok, by now I was able to perform some tests. Indeed the results of MCOMMAND_MAKEEDITABLE are not as expected. But this is also the case, when using "Make Editable" from the user interface.
    Instead use MCOMMAND_CURRENTSTATETOOBJECT to get the desired result.



  • On 03/08/2017 at 08:32, xxxxxxxx wrote:

    Now I have even had the chance to talk to one of the developers of the Houdini Engine Integration. And suddenly everything becomes clear. I'm sorry, you had so wait to long, but to be honest so far SDK Team had only very little contact with Houdini.

    So, the point is, the top level Houdini Generator object (the one with the logo icon and toggling between red and green based on status) does not actually generate any geometry.
    That's the reason Make Editable on this generator does not work and I guess, also Thea can't render it. This top level object just creates the actual generators as it's children. On these you can do "Make Editable" and it works as expected. But I guess, Thea will miss these, as it doesn't expect children of a Generator to be independent stand alone generators (instead of inputs to the parent generator).

    So (I don't have Thea here for testing) maybe it's worth trying the following with Thea:
    You can move the child generators out of the top level generator (i.E. moving the child creator next to the top level generator). The actual Houdini stuff will still keep working, it's just no longer organized in this parent child order. I could imagine, that Thea then is able to recognize the actual generator and will render it just fine. Would be nice, if you could let us know, if this works.



  • On 04/08/2017 at 04:56, xxxxxxxx wrote:

    Thanks for your help but I tried all these different things. The only thing that worked for me is converting the object inside the thea render to a polygon object via the UI. But with an animation of about 200F it's not very efficient to do this by hand for each frame.

    The script gets the object inside the houdini generator in the first line. The python tag is applied to the houdini generator and the script is using its child and converts it to a different null object. This null is not a child of the houdini generator. In theory this is the procedure I used while doing this per hand.

    Moving the child generators outside of the main generator did not work until I made those generator editable.

    BTW:
    With c4d standard renderer my script works just fine and the converted generator is rendered perfectly.

    Currently my main problem is to understand why the script returns a null object after the conversion started but a totally normal c4d.PolygonObject before the conversion.

    Shouldn't the python generator return the same object all the time when it's executed with the same data input?



  • On 04/08/2017 at 11:30, xxxxxxxx wrote:

    Do you need to have motion vector on the generated object. Because I can provide you a solution using something similar than https://www.c4dcafe.com/ipb/forums/topic/99105-modify-a-python-script-for-obj-sequence/ but instead of makinf obj you just make obj under a null order with the frame number and you make a tag for display the one according the frame.

    But just answerd me if you need motion vector because with my method you cant have motion to work. And did you try to export into abc? Normally the abc work pretty well. And i'm sure Thea support it.



  • On 04/08/2017 at 11:31, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    Do you need to have motion vector on the generated object. Because I can provide you a solution using something similar than https://www.c4dcafe.com/ipb/forums/topic/99105-modify-a-python-script-for-obj-sequence/ but instead of makinf obj you just make obj under a null order with the frame number and you make a tag for display the one according the frame.

    But just answerd me if you need motion vector because with my method you cant have motion to work. And did you try to export the whole sequence into one abc? Normally the abc work pretty well.I oftenly use for bake thing its very efficient ! And i'm sure Thea support it.


Log in to reply