• Writing data to the .c4d file

    Cinema 4D SDK r20 python
    26
    0 Votes
    26 Posts
    16k Views
    ?
    @m_magalhaes said in Writing data to the .c4d file: You can also use del that is pythonic bc = doc.GetDataInstance().GetContainerInstance(MyUniqueId) bc.RemoveData(2000) #del (bc[2000]) Wonderful, @m_magalhaes , thank you so much!
  • 0 Votes
    4 Posts
    612 Views
    S
    Hello, there is no thing as mouse direction. The mouse has a position. The direction is the result of comparing two mouse positions. as @zipit stated, you can create a tool that implements MouseInput(). Within MouseInput() you can use ViewportSelect.PickObject() to check what object and what point the mouse is currently over (Using BaseView.SW()). You can store the previous mouse position and compare it to the current mouse position to calculate the direction. Unfortunately, there is an issue with the Python version of PickObject() (How do I find the z-depth with Python ViewportSelect.PickObject()?), so you might have to implement your idea as a C++ plugin. You find some code in the pickobject.cpp example. best wishes, Sebastian
  • Detect if inside the Material Editor

    Cinema 4D SDK python r19 r20 r21
    2
    0 Votes
    2 Posts
    320 Views
    ferdinandF
    Hi, check RENDERFLAGS (Link). You will have listen in NodeData.Message() for them. I never did use this, but checking for RENDERFLAGS_PREVIEWRENDER sounds promising. Cheers zipit
  • 0 Votes
    10 Posts
    2k Views
    L
    @m_adam said in How to get mouse drag info from external through Python API?: Hi sorry about the confusion of server.close I was referring to self.sock.close. After some tests the main issue with your code is currently recvfrom is blocking, meaning until it receives something all the code is blocked, so TestBreak is never called and the thread never ends. So using timeout solve the issue. import c4d import socket class A(c4d.threading.C4DThread): sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) end = False def Main(self): self.sock.bind(("localhost", 20014)) while True: # use timeout to check for TestBreak() try: self.sock.settimeout(1.0) self.sock.listen(1) conn, addr = self.sock.accept() # connection print('Connection address:' + str(addr)) data = conn.recv(BUFFER_SIZE) if not data: print("Got no data.") break else: print("received data:" + str(data)) print str(data) self._data = str(data) # DO SOMETHING conn.close() # timeout except: if self.TestBreak(): self.sock.close() self.End() return continue self.sock.close() if __name__ == "__main__": threadedServer = A() threadedServer.Start() Cheers, Maxime. Awosome, the whole script works very well now, thanks man, you help me quite a lot! mua~
  • Highlight Hover on GeDialog Buttons?

    Cinema 4D SDK python r21
    4
    0 Votes
    4 Posts
    785 Views
    B
    @zipit and @m_magalhaes Thanks for the confirmation. Will close this thread for now. Will just ask separate question on GeUserAreas.
  • Inserting an Image Shader into a Dynamic Slot

    Cinema 4D SDK r20 python
    6
    0 Votes
    6 Posts
    905 Views
    S
    @blastframe said in Inserting an Image Shader into a Dynamic Slot: This is the C++ code of the shader: Hello, just to make things clear: the above snippet is NOT the "C++ code of the shader". It is the resource parameter description, that defines the parameter types and layout. See Description Resource. best wishes, Sebastian
  • AttributeError: 'list' object has no attribute 'FindTrack'

    Cinema 4D SDK
    10
    0 Votes
    10 Posts
    2k Views
    A
    @m_magalhaes Thanks. Next time I will follow the instruction. Thanks
  • Dynamically Import All Python Files

    General Talk r21 python
    5
    0 Votes
    5 Posts
    2k Views
    B
    @m_adam Thanks for the additional insight and the related links. Appreciate it a lot.
  • Transparency of GeDialog?

    Cinema 4D SDK r21 python
    8
    0 Votes
    8 Posts
    1k Views
    i_mazlovI
    Hi James, from my side there's nothing to add to Gheyret's answer. As of now there's no such option to achieve transparency of the GeDialog. Using third-party libraries could be a potential option, but we don't provide any support for this case. Cheers, Ilia
  • Move object axis problem in python

    Cinema 4D SDK python
    9
    1
    0 Votes
    9 Posts
    2k Views
    gheyretG
    @r_gigante Yes! It's really helpful.
  • 0 Votes
    19 Posts
    3k Views
    S
    Hello, as said before, it is not the purpose of GetVirtualObject() to edit the scene or to edit elements of the scene; this includes materials.
  • LAYOUTGROUP Description Resource

    Cinema 4D SDK python c++
    3
    3
    0 Votes
    3 Posts
    907 Views
    mfersaouiM
    @zipit said in LAYOUTGROUP Description Resource: STATICTEXT { JOINENDSCALE; } I'm searching this solution for long time, thank you so much!!!
  • Modified Pop Up Menu

    Cinema 4D SDK r21 python
    7
    0 Votes
    7 Posts
    1k Views
    ManuelM
    Hello, Thanks for sharing your answer @zipit and @Cairyn Cheers, Manuel
  • 0 Votes
    4 Posts
    729 Views
    B
    @C4DS Thank you. Works as expected!
  • HTTP Requests with `maxon` API

    Cinema 4D SDK python
    5
    0 Votes
    5 Posts
    1k Views
    dskeithbuckD
    @m_adam said in HTTP Requests with `maxon` API: Hi @dskeithbuck thanks a lot for trying to use the new Maxon API. Thank you so much for the working sample code, that answers my question. I look forward to switching over to the Maxon API for URL requests once these kinks get worked out.
  • Delete points based on distance

    Moved Cinema 4D SDK python
    13
    0 Votes
    13 Posts
    3k Views
    A
    I thing after short research that c4d.plugins.ObjectData could actually be the solution I am after. I will be posting my progress here. Once again Thanks Guys for heads up!!!!! Thanks
  • Distributing Python Plugins that have Dependencies

    Cinema 4D SDK
    14
    0 Votes
    14 Posts
    4k Views
    dskeithbuckD
    @m_adam said in Distributing Python Plugins that have Dependencies: As an Idea but didn't try and will not have the time to do it today (so if you try, do it at your own risks), but you could try to install things using directly the python executable from the resource folder I'm moving onto different parts of development, but I'll likely want to investigate this later and will post an update if I do. Thanks!
  • Join command result offset

    Cinema 4D SDK r20 c++ python
    3
    0 Votes
    3 Posts
    631 Views
    rsodreR
    @m_adam Hi Maxime, Thanks for this workaround, indeed puts the polygon on the right place. Best, roger
  • Node Editor API for R21?

    Cinema 4D SDK r21 python
    6
    0 Votes
    6 Posts
    796 Views
    F
    @s_bach OK, thanks!
  • Creating Pop-up Menus

    Cinema 4D SDK r21 python
    5
    0 Votes
    5 Posts
    1k Views
    B
    @m_adam RE: Maya radial Yea, it by theory the multiple gedialogs with pop-up from certain distance from the mouse should create a radial. I'll probably have it for another time/thread. Thanks for the response. Will consider this thread close RE: non working code example. Sure sure. Will let you know if anything comes up. The codes I referred above was from awhile ago, so I don't have immediate memory of them.