Overall Scene Size (polygon objects)



  • On 28/02/2013 at 00:59, xxxxxxxx wrote:

    How do I get the overall Scene Size (not Document size) of the actual polygon Objects in the scene.

    Do I have to Loop over the objects and get all the dimensions and therefrom the maximum points or the bounding box - or is there a better solution?

    Ideal would be the output of a Cube surrounding the "main" object for further calculations.

    kind regards
    mogh



  • On 28/02/2013 at 01:56, xxxxxxxx wrote:

    BaseObject.GetRad() returns a vector containing the 'radius' of the bounding box. the method
    could be named better though :)



  • On 28/02/2013 at 03:19, xxxxxxxx wrote:

    Yes this is the fastest way to get the bounding box. but how to handle all the objects is there a faster way than looping through all the objects.

    Anyway thanks littledevil



  • On 28/02/2013 at 13:13, xxxxxxxx wrote:

    How should there be? This is a too specific request as it would be included as a function in the API,
    and even if it would be included in the c4d module, it internally would require to iterate over all
    objects in the OM as well (although in C++, little faster ;).

    Go through all objects, take their global position, mid-point and radius and compute the bounding-box
    of the document. You can use the AABB helper-class of the c4dtools module for this!

    Best,
    -Niklas



  • On 28/02/2013 at 22:13, xxxxxxxx wrote:

    Ok thanks NiklasR, the I will do that. Was just thinking that perhaps that the doc or the clipping would have stored some data which could help.

    then loping over all objects it is.

    kind regards



  • On 28/02/2013 at 23:04, xxxxxxxx wrote:

    Ah, I see what you meant. No, there's no such data available (at least for Python, not sure for C++,
    but I guess not).

    Best,
    -Niklas


Log in to reply