• Migrating from the Classic API

    Cinema 4D SDK
    3
    0 Votes
    3 Posts
    770 Views
    C4DSC
    Thanks Riccardo, It all (well, some of it) starts to make sense after your explanation. A big step forward in starting to understand how to proceed with the MAXON API.
  • BaseContainer::SetMemory() question

    Cinema 4D SDK c++ r19 r20
    6
    0 Votes
    6 Posts
    1k Views
    a_blockA
    Hello Roger, my thought was, if you allocated buffer properly via NewMem (or one of its siblings), then you should be able to use it directly. But as Cinema 4D will do an internal copy and destroy the passed buffer, you'd need to do something like this (pseudocode): SetMemory(buffer) buffer = GetMemory() // to get the pointer to the buffer owned by Cinema // ... and then in the end, if you need to free the memory yourself and can't rely on the memory being destroyed on destruction of the BaseContainer buffer = GetMemoryAndRelease() Free(buffer) Just thinking and probably you have thought of this option anyway. Cheers, Andreas
  • 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.
  • 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
    625 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
    861 Views
    P
    Ok this was defently my fault. It works now. I was using GetVirtualObjects instead of GetContour.
  • OBJ loading polygon order

    Cinema 4D SDK c++ r20
    9
    0 Votes
    9 Posts
    2k Views
    kbarK
    It could be. I never got around to investigating it any further. But if/when I do I will have a look at that flag for sure. Since in my tests there was definitely something going on with the polygon indices. Thanks for investigating this further and also for reporting your findings. Really helpful.
  • Lots of "unresolved external symbol" errors

    Cinema 4D SDK c++ windows r20
    9
    0 Votes
    9 Posts
    2k Views
    a_blockA
    Hi, we are glad @rui_mac you were able to solve your problem. I'd just like to quickly recap to make this also clear for future readers. Visual Studio has two "concepts" two organize your development work. Projects, which is basically a set of files plus a bunch of configuration options and instructions for the tool chain (compiler, linker,...) to build a binary (in our case here always a plugin library). Solutions, which are collections of above projects plus some additional global configuration data and more important, information on dependencies of the contained projects. Now, our project tool can and does create both projects (for your plugins and for our frameworks) and a solution containing all of the above (actual workflow described in our docs under the links provided by Riccardo earlier on in this thread). So when you open such a solution and build your plugin project, also the frameworks it's depending on should be built.So, this is the way to go (project tool -> solution and projects -> open solution in Visual Studio). But if you instead open just one of the generated projects directly, Visual Studio will implicitly generate a solution for you, but it still lacks the framework projects and the build of the opened project will fail (error: unresolved symbols, i.e. function or class names normally provided by our frameworks and used in the plugins code can not be resolved). I hope this makes it a bit easier to understand. Cheers, Andreas
  • How to set project scale

    General Talk r20 python
    6
    0 Votes
    6 Posts
    3k 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
  • 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
  • R20 equivalent of GeSignal

    Cinema 4D SDK r20 sdk c++
    7
    0 Votes
    7 Posts
    2k Views
    P
    Hello. The problem was that I didn't add the definitions. iferr_scope; signal = maxon::ConditionVariableRef::Create() iferr_return; Thank you for your time and sorry for that
  • FormatStatement and maxon DataTypes...

    Cinema 4D SDK r20 c++ windows
    5
    0 Votes
    5 Posts
    1k Views
    M
    Ah, thank you. I didn't take a look at vec.h. Meanwhile, I already wrote a conversion unit to handle all sorts of formatting. Thought, it was possible to modify the intern string conversions somehow. But nevermind, all works pretty well. Cheers, Robert
  • Change Hair preferences with Python API

    Cinema 4D SDK python r20
    3
    0 Votes
    3 Posts
    976 Views
    merkvilsonM
    @mikeudin We all have to learn C++
  • Register Plugin during runtime

    Cinema 4D SDK python r20 windows
    3
    0 Votes
    3 Posts
    762 Views
    B
    Ok, thanks Riccardo! I'll register them at the start then.
  • Enable/Disable drop down (LONG) elements

    Cinema 4D SDK r20 c++ sdk
    3
    0 Votes
    3 Posts
    659 Views
    O
    Hi @a_block Thank you for your answer.
  • Compatibility between R20 versions

    Cinema 4D SDK c++ windows macos r20
    2
    0 Votes
    2 Posts
    499 Views
    M
    Hi Franck, backward and upward compatibility for the current major release is something we really consider and try our best to not break. Unfortunately, for R20 plugins, they need to be recompiled to make them compatible with R20 SP1. See C++ Index or either in the R20.026 changelog. You may encounter an issue with plugin compiled with R20.011 (see the R20.026 changelog) since you may override maxon dedicated IDs which will break for sure some C4D/plugin stuff. Cheers, Maxime.
  • Texture Tag Output

    Cinema 4D SDK c++ sdk r20
    15
    0 Votes
    15 Posts
    3k Views
    D
    Hi Riccardo, Thanks for the first response. My bad with not catching that it was a layer shader bug, I figured I had done something wrong with the sampling. I'll start looking into the other projection samplings. Dan
  • Changing hierarchy draw order / priority

    Cinema 4D SDK c++ r20
    4
    0 Votes
    4 Posts
    796 Views
    M
    Hi @rsodre, thanks for your feedback, and glad you solved your issue. Regarding the DisplayControl I let you read this topic: SceneHook and DisplayControl. Manuals, for scenehooks is definitely something we consider. Cheers, Maxime.
  • CUSTOMGUI_TREEVIEW in GetDDescription()

    Cinema 4D SDK c++ r20
    4
    0 Votes
    4 Posts
    1k Views
    K
    Sebastian, Added tags. Not really a question but a request. I thought that I had read about people adding a TreeView to the AM using GetDDescription() but maybe it wasn't as well fleshed out as they (or I) suspected. I will look into the custom data type and GUI for it. Please mark as Solved. Thanks! Robert