• How to modify the index

    Cinema 4D SDK s26 c++ windows
    4
    1
    0 Votes
    4 Posts
    818 Views
    P
    @ferdinand Thank you for your reply
  • TempUVHandle always None! Why?

    Cinema 4D SDK r21 python windows
    3
    0 Votes
    3 Posts
    678 Views
    ThomasBT
    @i_mazlov Thank you very much for the hint with the texture view and for the helpful links. The second thread I have already read, but was not able to find the solution so far. I study these examples. Thank you.
  • Natvis settings not working?

    Cinema 4D SDK windows c++
    5
    0 Votes
    5 Posts
    873 Views
    ferdinandF
    Hey @bojidar, well, we do not write these object views (the natvis for MSVC and the Python scripts for Xcode) for public usage but for internal usage. That we hand them out to third parties is just a courtesy. When we are looking at maxon::GraphNode, <Type Name="maxon::GraphNode"> <DisplayString Condition="_mem[0] != 0">{((maxon::NodePath*)&amp;_mem[0]),na}</DisplayString> <!-- Root will have empty path and valid graph --> <DisplayString Condition="_mem[0] == 0 &amp;&amp; _graph._object != 0">Root</DisplayString> <DisplayString Condition="_mem[0] == 0">nullptr</DisplayString> <Expand> <Item Name="Path">(((maxon::NodePath*)&amp;_mem[0])),na</Item> <Item Name="Kind" Condition="_mem[0] != 0 &amp;&amp; _graph._object != 0">(maxon::NODE_KIND)((((nodes.module.xdl64!maxon::nodes::NodePathImpl::CountAndKind*) &amp; (*(nodes.module.xdl64!maxon::nodes::NodePathImpl**) &amp; _mem[0])->_path))->kind &amp; 0xFF)</Item> <Item Name="Kind" Condition="_mem[0] == 0 &amp;&amp; _graph._object != 0">maxon::NODE_KIND::NONE</Item> <Item Name="Info">((nodes.module.xdl64!maxon::nodes::NodesGraphModelImpl::Info*)this->_mem),na</Item> <Item Name="Graph">(this->_graph)</Item> <Item Name="Graph Storage">(this->_mem)</Item> </Expand> </Type> then there are indeed quite a few references to the implementation (which means that this cannot work in the public API). You could rip these out to make it work, but would then be left with only a small subset of the debug attributes. But that would be up to you. In general, you can expect the Cinema API to be more conservative and almost all object views working there, while the Maxon API is generally more internal in nature. Cheers, Ferdinand
  • 0 Votes
    3 Posts
    581 Views
    B
    Hey Ferdinand, Thank you for the quick response! Ah ok I see. Thank you for the provided information, I will have a look at it. But I can also wait for the moment. My work arround for now would be to simply set everything up / import the parameters and colors with color management set to 'Basic' and manually doing the conversion via 'Convert to OCIO' in the Project settings. Thats giving me the correct result. But thanks again! Cheers, Ben
  • 0 Votes
    8 Posts
    1k Views
    S
    Hello @ferdinand ! Thanks for answer it is very clear, i will use virtual resolution from now on
  • 0 Votes
    4 Posts
    673 Views
    ferdinandF
    Hey Kent, it depends a bit on the context. Generally, yes, flags and parameters passed to a BaseBitmap are piped through to the underlying ImageRef. But as I hinted at with the TIF settings for BaseBitmap::Save, some stuff is also ignored. For fundamental stuff like initializing a bitmap with a channel depth, color format, etc., I am not aware of cases where flags are being ignored. But as I wrote in my pseudocode example, the exact nature of the BaseBitmap::GetImageRef is also quite important. My very high level advice would be, use the Maxon Image API directly for simple things like loading, color converting, or saving an image, but avoiding it for complex tasks like for example assembling a multi layer image or drawing (not possible at all in the public API apart from 'dumb' pixel by pixel drawing). The problem with this is that when you must have a BaseBitmap output. Because while you can get an ImageRef from a BaseBitmap instance, there is no 'sane' public way to construct a BaseBitmap from an ImageRef you can of course copy over the buffer manually (not so sane) and there is a private way to do this but has its pitfalls (but is possible to do with the public API). As I said, I would invite you to reach out to us with some code and a concrete use case when you get stuck, I will then be able able to help you specifically. Cheers, Ferdinand PS: We recently dropped the term 'classic API' in favour of 'Cinema API'. We also capitalize now 'Maxon API'. Just saying this for clarity.
  • Vertex Map Tag not in sync error

    Cinema 4D SDK python 2024 windows
    3
    1
    0 Votes
    3 Posts
    606 Views
    D
    Hi Ilia, Thank you very much, I was not aware of that! Cheers!
  • 0 Votes
    4 Posts
    838 Views
    ferdinandF
    Oh, my bad, I did overlook that you flagged this as S26. Yes, mxutils is a 2024+ feature. I used it here to carry out type checks, e.g., that a document or bitmap are not null/none. The code will run without them, but it will fail more gracefully with these checks. You could replace these calls with manual checks: bmp: c4d.bitmaps.BaseBitmap = c4d.bitmaps.MultipassBitmap( int(rData[c4d.RDATA_XRES]), int(rData[c4d.RDATA_YRES]), c4d.COLORMODE_RGB)) if bmp is None: # or more precise: if not isinstance(bmp, c4d.bitmaps.BaseBitmap) ... raise MemoryError("Failed to allocate bitmap.") Cheers, Ferdinand
  • 0 Votes
    4 Posts
    844 Views
    O
    And that's good to know about using GetMl() over Get Mg(), mainly for the performance reasons if I understood correctly.
  • SetPortValue for Texture node ColorSpace

    Cinema 4D SDK python 2024 windows
    3
    0 Votes
    3 Posts
    683 Views
    M
    Thank you so much, this was very helpful to learn. All the best.
  • 0 Votes
    5 Posts
    1k Views
    ferdinandF
    Hey @lednevandrey, without wanting to be rude, I really struggle with understanding what you want to convey. Material[c4d.TEXTURETAG_PROJECTION] = c4d.TEXTURETAG_PROJECTION_UVW does not work because Python is case sensitive and you gave your BaseMaterial instance the symbol material. So, Python is complaining about that. But as said before, a material, i.e., BaseMaterial is not the right place to set the projection. It is the counter part to the thing you see in the Material Manager of Cinema 4D and has no projection. The projection is set in the Material Tag, which slightly confusingly is called TextureTag in the API. Cheers, Ferdinand """Assigns the first material in the document to the selected object and sets its projection to UVW. """ import c4d import mxutils doc: c4d.documents.BaseDocument # The currently active document. op: c4d.BaseObject | None # The primary selected object in `doc`. Can be `None`. def main() -> None: """Called by Cinema 4D when the script is being executed. """ if not op: raise ValueError("Please select an object.") # Get the first material in the document. material: c4d.BaseMaterial = doc.GetFirstMaterial() if not material: raise ValueError("No materials found in the document.") # Get the first existing texture tag on #op or create a new one when none exists. tag: c4d.BaseTag = op.GetTag(c4d.Ttexture) or op.MakeTag(c4d.Ttexture) if not tag: raise ValueError("Failed to get or create a texture tag.") # Set the material and projection. tag[c4d.TEXTURETAG_MATERIAL] = material tag[c4d.TEXTURETAG_PROJECTION] = c4d.TEXTURETAG_PROJECTION_UVW # Update the Cinema 4D UI. c4d.EventAdd() if __name__ == '__main__': main()
  • 0 Votes
    6 Posts
    1k Views
    ferdinandF
    Great to hear that you found your solution! Do not hesitate to ask more questions when you run into problems while exploring our Python API. But just as a heads up, we prefer users opening new topics for new questions. For details see the Support Procedures linked above. Cheers, Ferdinand
  • 0 Votes
    8 Posts
    1k Views
    DunhouD
    Wow @m_adam , thanks for that, I'll check this after work!
  • 0 Votes
    2 Posts
    573 Views
    M
    Hey BigRoy, sadly it's still impossible, I will start the discussion again, thanks for the reminder. Cheers, Maxime.
  • 0 Votes
    5 Posts
    1k Views
    R
    I was just looking for the exact same thing and would second the need for these 3 hooks without the need for a Python Generator object. It would make the pipeline integration of C4D much more straightforward. @m_adam
  • 0 Votes
    3 Posts
    641 Views
    i_mazlovI
    Hi @datamilch, you can use the EVMSG_CHANGE message as a trigger to check your objects for changes. The timer approach might seem imprecise from the first glance, but can actually be used, I don't think there're any significant reasons against it. Additionally, the recent change was made to make BaseList2D being hashable. This effectively means you can operate with your objects in a dict. The python tag approach is the least efficient, although would still work, yes. You're saying your GeDialog plugin uses "mostly the ideantical userdata". If it was "identical", you could potentially use c4d.gui.DescriptionCustomGui with the SetObject function to make it point to your object. This way you can avoid hassling around all the data sync, because it is all handled as a built-in functionality of this class. This is how the attribute manager effectively works, or the Active Object Dialog as well. For your further postings please follow our guidelines on How to Ask Questions, namely: Please consolidate your questions into a singular posting by editing your last posting Cheers, Ilia
  • 0 Votes
    3 Posts
    776 Views
    K
    Alright! Thats a sweet improvement. Okay no worries we'd already moved to the method you described! Does this change back propagate to earlier versions like 2023?
  • Copy to the OS clipboard

    Cinema 4D SDK windows macos
    2
    0 Votes
    2 Posts
    406 Views
    i_mazlovI
    Hi @César-Vonc , Cinema 4D uses OS clipboard to some extent, namely as you can see from the CLIPBOARDTYPE enum there's text and image clipboard options. For other Copy&Paste functions the built-in clipboard system is used, hence the OS clipboard stays untouched. Cheers, Ilia
  • CopyBitmapToClipboard gamma issue

    Cinema 4D SDK python 2024 windows
    2
    1
    0 Votes
    2 Posts
    421 Views
    i_mazlovI
    Hi @John_Do, Please note that this forum is for the public APIs of Maxon products related topics. We unfortunately cannot help with the end user issues. Please ask your end user questions in our Support Center. This and also other important considerations are mentioned in the Scope of Support part of our Support Procedures. With that's said, your question gives a fuzzy impression on what exactly you're asking about. Namely, you're talking (presumably) about the CopyToClipboard() function, but then also claim the issue is not there, rather when you paste this bitmap in the PV. Could you please share some code snippet, which highlights the issue, especially the pasting part, which seem to not work as expected. Please also make sure you've setup the Picture Viewer's View Transform to meet your needs. In our internal bug tracking system I'm also seeing 2 issues that we already keep track of: A-B comparison issue that was just recently fixed and is not yet released Picture Viewer issue with OCIO enabled when using EXR files However, none of these seem to be specifically related to your case. If you're still having this issue and it is not related to our SDK, I would kindly ask you to reach out to our Support Center. Cheers, Ilia
  • 0 Votes
    4 Posts
    839 Views
    H
    @i_mazlov Thanks much for explanation.