• 0 Votes
    2 Posts
    434 Views
    i_mazlovI
    Hi @shahir-zaman , Welcome to the Maxon developers forum and its community, it is great to have you with us! Getting Started Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules. Forum Overview: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment. Support Procedures: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support. Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads. It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: Asking Questions. About your First Question Assuming that what you're trying to achieve is to toggle the "UV Grid" option [image: 1734354534219-d09d5b8d-51a2-4a6a-9618-90b2dbcc6638-image.png] You effectively have two options: The easiest one is to execute CallCommand(170776) (you can find the command ID in the Script Log) The more involved but also more flexible way is to find the UV settings scenehook and go through all its branches (or may be not all of them, depending on what specifically you want to achieve). Please find the C++ and Python code snippets below. Cheers, Ilia C++ commanddata execute function code snippet: Bool MyCommandData::Execute(BaseDocument* doc, GeDialog* parentManager) { const Int32 ID_UV_SETTINGS_HOOK = 1053309; if (!doc) return true; BaseSceneHook* sceneHook = static_cast<BaseSceneHook*>(doc->FindSceneHook(ID_UV_SETTINGS_HOOK)); if (!sceneHook) return true; maxon::BufferedBaseArray<BranchInfo, 20> infos; sceneHook->GetBranchInfo(infos, GETBRANCHINFO::NONE) iferr_ignore("GetBranchInfo"); for (BranchInfo& info : infos) { if (info.name != "UVSettingsBranch"_s) continue; GeListNode* viewSettings = info.head->GetFirst(); while (viewSettings) { GeData value; viewSettings->GetParameter(CreateDescID(UV_SETTINGS_FILTER_SHOW_GRID), value, DESCFLAGS_GET::NONE); Bool valueBool = value.GetBool(); value = {!valueBool}; viewSettings->SetParameter(CreateDescID(UV_SETTINGS_FILTER_SHOW_GRID), value, DESCFLAGS_SET::NONE); viewSettings = viewSettings->GetNext(); } } EventAdd(); return true; } Python script code snippet (special thanks to @m_adam on this one): import c4d def main() -> None: sh = doc.FindSceneHook(1053309) for branch in sh.GetBranchInfo(): if branch["name"] != "UVSettingsBranch": continue viewSettings = branch["head"].GetFirst() while viewSettings: viewSettings[c4d.UV_SETTINGS_FILTER_SHOW_GRID] = not viewSettings[c4d.UV_SETTINGS_FILTER_SHOW_GRID] viewSettings = viewSettings.GetNext() c4d.EventAdd() if __name__ == '__main__': main()
  • Get and Set any parameter with Tag

    Cinema 4D SDK 2023 2024 2025 python
    3
    0 Votes
    3 Posts
    685 Views
    gheyretG
    Hi @i_mazlov I can't use C++ at the moment, so I thought I'd try MultilineEditText for my purposes. I looked for This post in the forum and now I have some ideas. Thank you for your reply! Cheers~
  • 0 Votes
    3 Posts
    1k Views
    gheyretG
    Thank you for your reply and solution! Cheers~
  • 0 Votes
    7 Posts
    2k Views
    i_mazlovI
    Hi @yaya, I see your point here and I can only guess if such behavior is expected or not, as this is (and I've already mentioned this to you earlier) a question that has nothing to do with development. In general it sounds like a bug, so you're very welcome to reach out to our Support Team and ask them for a proper workaround if they actually classify this issue as a bug. I'm moving your thread to general talk section in case someone from our community might be willing to share their experience on that topic. Cheers, Ilia
  • GraphModelInterface.GetNode not worked

    Cinema 4D SDK python windows 2025
    3
    0 Votes
    3 Posts
    598 Views
    DunhouD
    Hi @m_adam , Thanks for your reply, it worked well. But I still have some doubts about the usage of Node Path, such as how to calculate the port through NodePath instead of concatenating strings (which can easily lead to misoperation). There are few examples and answers for NodePath on the forum, and it seems that people rarely use it. Do you have any insights on this, or in other words, what usage scenarios do you think NodePath is more suitable for. Cheers~ DunHou