How to hide object completely



  • On 31/01/2013 at 18:32, xxxxxxxx wrote:

    Hi, in my Python tag I create a null helper object. I do not want this object to show up under Objects at all. Is it possible to hide it completely?
    I also want to set its display property to "None", how do I do that?
     

     
    TIA
    -Ingvar



  • On 31/01/2013 at 22:46, xxxxxxxx wrote:

    Your image-url is broken.

    You can hide it from the OM using ChangeNBit with the NBIT_OHIDE flag. But it
    keeps being in the document structure, however.



  • On 01/02/2013 at 18:40, xxxxxxxx wrote:

    Hi Niklas, it worked! Thanks!
    I have only one little detail left - I do want to set the Display mode to None. And I found no way so far. I see the "dot" all the time, and it serves no purpose since it is a helper object. Do you happen to know hpw to set the null's Display mode to None, using Python?
     
    -Ingvar



  • On 02/02/2013 at 02:10, xxxxxxxx wrote:

    Just print out the Null-Objects Display parameter after you've set it to None. You can then
    use this value to set the parameter. Not sure if there's a symbol for it. If so, it would be better
    to use that symbol instead of the integer ID directly.

    import c4d
    for k, v in vars(c4d).items() :
        if v == op[c4d.NULLOBJECT_DISPLAY] and k.startswith("NULLOBJECT") :
            print k
    


  • On 02/02/2013 at 11:56, xxxxxxxx wrote:

    Thanks Niklas, I will try to understand this, and in turn try to use it in a meaningful way.
    But let me ask you a couple of questions, and allow me to air some frustration..

    I am a professional programmer, for almost 20 years. Still  I can spend two day writing even the simplest Python tags. The reason is that I just can't find out how to do things.
    Fo instance, where is this documented: op[c4d.NULLOBJECT_DISPLAY] and k.startswith("NULLOBJECT") ?
     
    I downloaded the latest C++ SDK for R14. I searched for NULLOBJECT, I searched for NULLOBJECT_DISPLAY - no match whatsoever.
    I downloaded the latest Python SDK for R14. I made the same search - no match at all. Where the heck is all this tucked away? Regardless of how helpful people are, especially you, I cannot rely on the forums and helpful people to get answers.
     
    What do others do? Where do you have your knowledge from? Where can I find the information that you obviously know about? Where is NULLOBJECT_DISPLAY and tons of other constants and methods hidden?
    I can program in C++ instead of Python if that helps, but since the C++ doc is not better.. does it help?
     
    Edited :
    Ok, I found out that the Script Log window is my friend. A lot of activities are logged here, and here I find the NULLOBJECT_DISPLAY constant used when changing the Display property of a Null object.
    I have to learn to use this window, because it obviously can help me a lot.
    So the answer to my question is this:
    foo[c4d.NULLOBJECT_DISPLAY]=14
    where foo is the Null object, and 14 the value I watched being used in the Script Log window
     
    Any input is welcome :)
     
    -Ingvar



  • On 03/02/2013 at 04:05, xxxxxxxx wrote:

    Hi ingvarai,

    Originally posted by xxxxxxxx

    Fo instance, where is this documented: op[c4d.NULLOBJECT_DISPLAY] and k.startswith("NULLOBJECT") ?

    This is not documented anywhere, it is combining knowledge about the Python language. ;-)
    The vars() function is built-in and delivers a dictionary of all attributes of the passed object. I then
    compare the value of the Display attribute of the object to the current attribute and if its name starts with
    NULLOBJECT, I print it out. This is because constants usually are prefixed all the same for the same object.
    You can get c4d.NULLOBJECT_DISPLAY from dragging the attribute from the AM into the Script Manager
    (which is stated in the Py4D Docs).

    Originally posted by xxxxxxxx

    I downloaded the latest C++ SDK for R14. I searched for NULLOBJECT, I searched for NULLOBJECT_DISPLAY - no match whatsoever.
    I downloaded the latest Python SDK for R14. I made the same search - no match at all. Where the heck is all this tucked away? Regardless of how helpful people are, especially you, I cannot rely on the forums and helpful people to get answers.

    The description symbols of Objects are mostly not documented at all, as they can be retrieved via dragging
    the Attribute into the Script Manager or the Console, or by looking at the according description resource
    header file.

    Originally posted by xxxxxxxx

    What do others do? Where do you have your knowledge from? Where can I find the information that you obviously know about? Where is NULLOBJECT_DISPLAY and tons of other constants and methods hidden?
    I can program in C++ instead of Python if that helps, but since the C++ doc is not better.. does it help?

    The problem is, it requires you to gain experience with the API, getting to know how Cinema works. You're an
    experienced developer and expect to create awesome plugins right from the start. I've not been working with
    many APIs, but after working quite  while with it, my opinion is, that it is good for the It "mid level" things. Hard
    to start, hard to create very complex things. It is hard to create things that were not "intended". Things that
    have not been created for Cinema before in that manner, the API is not proven for, yet.

    For C++, I think it is definately easier to get into Cinema's internal with Python and then go to C++.

    However: Developing plugins for Cinema 4D is a complex task, the API is huge. You can not expect you
    to create awesome plugins just from the start, although you are a professional programmer. This is why
    we are here to help you out at the café. 🙂

    -N



  • On 03/02/2013 at 12:27, xxxxxxxx wrote:

    Thanks a lot, Niklas! Clap
    Your reply is overwhelming.
     
    I realize there is a learning curve. I want to say that I am spoilt. I have written several plugins for the Sony Creative applications, like Sony Sound Forge (sound "surgery" tool) and Sony Vegas, the Video NLE. These are written in C#, and I was able in almost no time to write anything I wanted. And, believe it or not, I hardly needed any documentation because in C# you have Reflection, and using Visual Studio and Code Completion, the source code is almost documenting itself. I can extract class hierarchies, I can see what class/object descends from what, I can see their properties and methods. Sony does not have to write much docs, they only need to comment each property and and method in the source code itself.
    Due to reflection and Visual Studio I then immediately can see the comments when hovering the mouse over a property or method.
     
    So I spent a half day writing a video proxy file management tool for Sony Vegas, whereas I spent three days making a spline point following the movement of a null object in C4D..
    Yes, I am spoilt coming from the C# and Windows world.
     
    The tips you gave me are invaluable. Dragging and dropping a property onto the Python generator gives me the symbols. But I now use the Script Log Window, which saves me a lot of time. The language self is ok, but I sorely miss a C style language.. If C4D had been written in C# - oh one can dream :)
    What is the preferred Python editor? I currently use Notepad ++
    To sum it up - its super good support and help here in the plug-in cafe, and I need it, because writing C4D plugins in Python is like starting programming in 1994 in Notepad, lacking almost all the new facilities I have gotten so used to in Visual Studio and C#-
     
    Edited:
    I found this traing which looks interesting  (German language) :
    http://www.video2brain.com/de/videotraining/python-grundlagen-fuer-cinema-4d
     
    -Ingvar



  • On 04/02/2013 at 05:37, xxxxxxxx wrote:

    Hi ingvarai,

    I know how you feel 😄. I'm a developer too and I just started to program for C4D 4 weeks ago. And yes, the API is very frustrating!
    So let me help you a bit with the little knowledge I found myself:
    I use Eclipse for developing with the Pydev module. Additionally I use the fake c4d module from this site: http://www.smart-page.net/blog/2012/11/04/python-cinema-4d-api-auto-completion-fake-modules/ which give me code completion (most of the time).
    And on this page http://www.smart-page.net/blog/2011/05/29/debugging-cinema-4d-python-plugins-with-pydev/ is descriped how to remote debug with pydevd module. At least I managed to get the debugging to work with scripts. I still work on the plugins ;)

    I hope this helps a bit.
    Greetings!

    €: Remembered that I found this remote debugger a few days ago:
    http://winpdb.org/download/ but I didn't tried it yet.



  • On 04/02/2013 at 17:04, xxxxxxxx wrote:

    Nachtmar,
     
    this was a HUGE step forward!!
     
    I spent the last two hours following the excellent instructions here:
    http://www.smart-page.net/blog/2011/05/09/advanced-python-plugin-coding-for-cinema-4d/
     
    I now have Eclipse installed, I have the fake modules installed and I have code completion (well, sort of) and am playing with the new Development environment. It is not Visual Studio and C#, but it is like advancing from walking to driving a car, skipping bicyckling, if you understand. A huge leap forward. It now looks feasible to develop plugins, even for C4D!
    The world will never be the same after this Big smile
     
    Currently I have developed three plugins for C4D. All of them out of the sheer need for functions that I did not find built into C4D, and at the same time did not find browsing the Internet. I will at some time publish these as freeware, on a new website I will develop (when I get the time to do it..).
     
    If you want, it would be interesting to have contact with other C4D developers, you can write me an e-mail at post at ingvarius dot com. If you are German, dann kannst Du auf Deutsch schreiben.
     
    Now off to Eclipse, I want to learn the IDE shortcuts.
    Oh - one fineal question: Is there some software out there which will automate creating and maintaining the *.res, *.h and *.str files?
     
    -Ingvar


Log in to reply