• Python missing ObjectColorProperties?

    Cinema 4D SDK r19 r20 python
    3
    0 Votes
    3 Posts
    723 Views
    C4DSC
    @cairyn You are right. I thought having to go over the BaseContainer obtained from the object via GetData(), but didn't see anything in its content related to the displaycolor ... didn't think of just accessing the object's properties directly. I am not that confident with the Python SDK. Thanks for the piece of code.
  • Merging external files into plugins

    Cinema 4D SDK python
    4
    0 Votes
    4 Posts
    788 Views
    M
    Hi Merkvilson, the best way would be in the NodeData.Init method to load the scene with LoadDocument(). This will give you a BaseDocument. Then you can retrieve the LineObject or whatever you need from this document. Then get a Clone of these things and draw it inside your Draw method. Just in case, if you would have to return everything in the GetVirtualObject methods, you would need to insert everything under a null and return this null. And to manually handles/tracks material (this part can become very tedious) If you have any questions, please let me know. Cheers, Maxime.
  • GetClone() with Fields

    Cinema 4D SDK r20 python windows
    4
    3
    0 Votes
    4 Posts
    1k Views
    GianniG
    Just tried now… It seems to work perfectly! Thank you! I don't want to boring you, but, please, don't disable this super feature in python. Instead you could update the documentation specifying well how to use it.
  • Subdialog, title

    General Talk python
    10
    1
    0 Votes
    10 Posts
    2k Views
    Passion3DP
    Thank you Maxime, I'll test all this
  • Spline shape for BaseDraw Handles

    Cinema 4D SDK python
    6
    0 Votes
    6 Posts
    1k Views
    M
    The best way would be to store directly the LineObject in a member variable of your ObjectData class. The alternative way to retrieves a LineObject (which is never visible in the ObjectManager) is to call GetCache() from a Spline Object. But a Spline Object can have multiple LineObject and a SplineObject (like any other objects) does not guarantee that a cache is available at any time. So if there is no cache, the best way would have been to clone the SplineObject to a Temporary document, call ExecutePass from this document in order to build the cache. Then retrieves the cached LineObject. But I think SplineHelp, is the best option you have which works in all case, easy to setup/use, is there any drawback to it? Cheers, Maxime.
  • 3 Votes
    6 Posts
    2k Views
    M
    Wow, very nice! There's a huge progress, it now works pretty fast. Thanks for adding the wishlist items.
  • Python Autocomplete in Script Manger

    Cinema 4D SDK python r20
    4
    0 Votes
    4 Posts
    1k Views
    mikeudinM
    @ipython "c4dpy.exe/app is an executable that runs Cinema 4D in Python command-line mode. It is not only an interpreter, it brings extra features for daily Python development with external code editors/IDEs: auto-completion and debugging."
  • 0 Votes
    2 Posts
    583 Views
    r_giganteR
    Hi Pyr, thanks for reaching us. With regard to the issue you reported, it looks like there's something unexpected happening that instead of returning the computed cache, regenerate and returns a new cache. Although it might occur that switching between documents require the generator to recreate the cache, switching between view definitively it's not supposed to happen. Considering that your information doesn't actually help too much in understanding how you're evaluating cache dirtiness nor what changes are you're checking in the vertexmap, could please post fragments of the code or, alternatively, try to reuse your cache dirtiness mechanism on an "simpler" plugin to see if it works reliably? Looking forward further comments, give best. Riccardo
  • 0 Votes
    3 Posts
    811 Views
    P
    Ok this was defently my fault. It works now. I was using GetVirtualObjects instead of GetContour.
  • Catch InputDialog Cancel?

    Cinema 4D SDK
    3
    0 Votes
    3 Posts
    777 Views
    M
    Hi Donovan, unfortunately, there is no change in this regards. The best way is still to check for an empty return value or either creates your own dialog. I've filled a feature request. Cheers, Maxime.
  • How to set project scale

    General Talk r20 python
    6
    0 Votes
    6 Posts
    2k Views
    r_giganteR
    @Rage if you're looking for a solution where the user is not involved, stick to the first answer where no CallButton() was considered. On the contrary using it will request the user to interact since there are no means to programmatically interact with the UI or scripting users' actions on the UI. Best, Riccardo
  • 0 Votes
    7 Posts
    2k Views
    K
    Thank you very much guys! I think that plugin will be better solution then script in this case. Cheers
  • Tag not in sync

    Cinema 4D SDK r20 python
    5
    0 Votes
    5 Posts
    2k Views
    r_giganteR
    Hi Rage, thanks for reaching us. With regard to the issue mentioned and considering your non-Cinema background, first of all lets settle down a few concepts: UVWTags are just acting as "storage" for the UVW data used on polygonal objects; TextureTags are instead used to create the actual texturing on the on a generic object (whatever it's a polygonal or parametric one) A parametric object can use a texture even without explicit an UVWTag since the TextureTag delivers all the information with regard on how to map a texture to the object. When a parametric object (e.g. cube) is converted into a polygonal one the UVW values which are part of the parametric object gets dumped in the UVWTag that is generated as soon as the conversion ends. That said give a certain object (a polygonal one) the way to go is: def main(): # check that an object is selected if op is None: return # get the active material activeMat = doc.GetActiveMaterial() if activeMat is None: return # instantiate a TextureTag sph50NoTileTextureTag = c4d.TextureTag() if sph50NoTileTextureTag is None: return # set the mapping type sph50NoTileTextureTag[c4d.TEXTURETAG_PROJECTION] = c4d.TEXTURETAG_PROJECTION_SPHERICAL # turn off tiling sph50NoTileTextureTag[c4d.TEXTURETAG_TILE] = False # scale the mapping to 50% on u and v sph50NoTileTextureTag[c4d.TEXTURETAG_LENGTHX] = 0.5 sph50NoTileTextureTag[c4d.TEXTURETAG_LENGTHY] = 0.5 # link to the active material sph50NoTileTextureTag[c4d.TEXTURETAG_MATERIAL] = activeMat # generate the corresponding UVWTag using the mapping settings specific in the TextureTag sph50NoTileUVWTag = c4d.utils.GenerateUVW(op, op.GetMg(), sph50NoTileTextureTag, op.GetMg()) # check for UVWtag being properly created if sph50NoTileUVWTag is None: return # set the name of the tag sph50NoTileUVWTag.SetName('0.5 non-tiled spherical') # add both the UVWTag and the TextureTag if op.GetTag(c4d.Tuvw) is None: op.InsertTag(sph50NoTileUVWTag) if op.GetTag(c4d.Ttexture) is None: op.InsertTag(sph50NoTileTextureTag) # notify Cinema about the changes c4d.EventAdd() Best, Riccardo
  • Object Generator Plugin With Dynamic Objects

    Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    727 Views
    S
    Hello, GetVirtualObjects() is called when the scene is updated. ExecutePasses() updates the scene. So you want to update the scene while the scene is updated. That's bad. Also, you create a virtual cube and add a tag to that cube. But you do not add the cube to any document. So updating any document would have no effect on that cube. Typically, one does not add a simulation tag to a virtual object. Such a tag is typically added to the generator that create the virtual objects e.g. you add a simulation tag to a MoGraph cloner to animate it virtual child objects. best wishes, Sebastian
  • PoseMorph Tag question

    Cinema 4D SDK
    5
    1
    0 Votes
    5 Posts
    1k Views
    M
    The mode specifies how data can be read from the Morph Tag. By default, they are presented in a compact way (aka only modified points are stored for some internal optimization). But if you SetMode with c4d.CAMORPH_MODE_FLAGS_ALL | c4d.CAMORPH_MODE_FLAGS_EXPAND then all the points are then readable from outside of the morph Tag. I adapted the Python documentation to match the C++ documentation so it will be available in the next documentation update. But I would say the C++ documentation for SetMode is pretty self-explanatory, what is the part you don't understand? Cheers, Maxime.
  • Global to Local pos

    Cinema 4D SDK python
    9
    0 Votes
    9 Posts
    2k Views
    Passion3DP
    Thank you @mp5gosu This is exactly what I was looking for. In fact, C4D does the calculations itself. I thought I had to do the matrix multiplication, and I didn't understand how to do it. Finally it's very simple
  • Bug: Constantly updating coordinates

    Cinema 4D SDK python
    2
    0 Votes
    2 Posts
    505 Views
    M
    Hi @merkvilson, Actually, the issue came from inserting the matrix as a child of the cached spline. The cached spline gets a rotation of X then you apply again the rotation of the generator, which make X+X rotation. In order to avoid that, return one null with both object. def GetVirtualObjects(self, op, hh): if not op.GetDown(): return None gch = op.GetAndCheckHierarchyClone(hh, op.GetDown(), c4d.HIERARCHYCLONEFLAGS_ASIS, False) output = gch["clone"] gchDirty = gch["dirty"] if not gchDirty: return output null = c4d.BaseObject(c4d.Onull) indexView = c4d.BaseObject(1018545) output.InsertUnder(null) indexView.InsertUnder(null) indexView[c4d.ID_MG_MOTIONGENERATOR_MODE] = 0 indexView[c4d.MG_OBJECT_LINK] = output return null If you have any questions, please let me know. Cheers, Maxime
  • Time Limit for MSG_DESCRIPTION_CHECKUPDATE

    Cinema 4D SDK python
    5
    0 Votes
    5 Posts
    960 Views
    S
    Hello, the message MSG_DESCRIPTION_USERINTERACTION_END has no data. You could store the old value of the parameter in question and check if that value has changed. best wishes, Sebastian
  • Prevent Editable Command

    Cinema 4D SDK python
    2
    0 Votes
    2 Posts
    531 Views
    r_giganteR
    Hi merkvilson, thanks for reaching us. With regard to your question, current Cinema 4D API doesn't deliver the desired behavior. Best, Riccardo
  • Change Hair preferences with Python API

    Cinema 4D SDK python r20
    3
    0 Votes
    3 Posts
    899 Views
    merkvilsonM
    @mikeudin We all have to learn C++