• How to import svg in S25 from path

    Moved python
    3
    0 Votes
    3 Posts
    888 Views
    I
    Thank you so much!
  • Best practices for a plugin containing multiple commands

    python
    4
    0 Votes
    4 Posts
    912 Views
    H
    Wow, thank you both for such detailed and informative replies! First of all, apologies @ferdinand for the tag issues, I was consulting the guidelines whilst typing my question but managed to miss the OS tag. Not sure if it matters too much for python dev, but I am on a Windows machine. I did however notice that the tag list doesn't seem to be updated to include R25 just yet (the version I'm currently working with), so it may need adding by the team. It doesn't look like I'm able to edit my original post past a certain time, but if you have the ability feel free to update Useful to know about the distinction between CommandData.ExecuteOptionID() and CommandData.ExecuteSubID(). The cogwheel icon present on some of the in-built commands was something that I'd noticed previously and been curious as to the implementation of - assumed it was just some complex code magic that added an additional button to the menu UI, ha! I guess that you're probably right in that I shouldn't try to run before I can walk, and if there's no limit to the amount of plugin IDs permitted (makes sense if there are hundreds of thousands of them going spare! ), then the keep-it-simple approach of registering multiple IDs would probably be best at this stage. For future reference though, if it is functionally the same as registering multiple IDs, do you know of any resources showing the implementation of CommandData.ExecuteSubID(), besides the docs; is this something that could be a candidate for an additional example in the SDK plugins repo? @Cairyn thanks for offering a more general insight into the situational decisions behind why something might be the 'best' choice (or not a choice at all!). I'm a designer first and foremost with an interest in coding, rather than the other way around, so considering the UX of a potential plugin and how it could fit into my own workflow is something I'm keen not to ignore To be a little more specific about how the plugin will function: essentially it will be a set of commands allowing the user to rapidly navigate around the viewport in a way that's a bit more custom than the default 'front, back, left, right, etc' views, as well as the ability to toggle between perspective and parallel views, ideally while keeping the same projection matrix (the hard bit!). My intention is to bind these commands to separate shortcuts so that they're a 'function at your fingertips' Actually I do have some additional questions about the ability to set keyboard shortcuts via a plugin, instead of the command manager, and how Cinema then deals with shortcut conflicts, but I think that's one for another thread! Definitely going to refer back to these suggestions as I continue my learning journey. Thank you both again!
  • Run command, after c4d fully loaded...

    5
    0 Votes
    5 Posts
    1k Views
    ymoonY
    Thank you.. It's Solved. @fwilleke80 @ferdinand and @kbar def PluginMessage(_id, data): if _id == c4d.C4DPL_PROGRAM_STARTED:
  • How to Register "Hot key" plugin in python?

    python r23
    5
    2
    0 Votes
    5 Posts
    1k Views
    gheyretG
    Hi @ferdinand , Thank you very much for your detailed reply. I think it is very helpful to me. Cheers!
  • R25 doesn't register the [c4d.ID_BASEOBJECT_COLOR] parameter

    Moved
    3
    1
    0 Votes
    3 Posts
    526 Views
    R
    @m_adam OK this is really weird. I tried this over and over yesterday for several hours. this morning it is working fine! It must have been a case of restarting my machine or something. All set on my end! Thanks for testing either way, much appreciated!
  • What's really happening inside a CKey?

    c++ python r23
    10
    0 Votes
    10 Posts
    2k Views
    CairynC
    DTYPE_LONG can be used with SetGeData if the track category is CTRACK_CATEGORY_DATA, see the third post in this thread. This is the only ambiguous datatype at the moment, and as other datatypes wouldn't make sense with SetValue I think it will remain the only one. But I do claim that the category of the track determines whether you need to use SetValue or SetGeData. (That is almost the same in effect... but in case of DTYPE_LONG not quite.)
  • Best way to store "Bake" Information

    3
    0 Votes
    3 Posts
    569 Views
    D
    Hi Manuel, I didn't think about CopyTo being called on undo. That might be all I need then, thanks. I did a couple tweaks and as of now everything is perfect. Dan
  • R25 Json Parser Usage

    3
    0 Votes
    3 Posts
    643 Views
    Danchyg1337D
    @m_magalhaes Thank you!
  • Vector.__xor__(self, other) error in documentation

    Moved python
    3
    1
    1 Votes
    3 Posts
    459 Views
    ferdinandF
    Hello @SteveJLV, the example has been fixed and both computations now will reflect the correct result. The fixed example will be included with an upcoming release of the Python SDK documentation. Cheers, Ferdinand
  • access predefined variable in another context

    Moved
    2
    0 Votes
    2 Posts
    529 Views
    ManuelM
    Hi, unless I'm wrong, you already asked the question on this thread Sorry for the delay, i was looking for a workaround solution. Cheers, Manuel
  • Preset option with shortcut or custom layout in CommandData plugin

    4
    1 Votes
    4 Posts
    729 Views
    César VoncC
    Thank you very much !
  • Python: How to get axis scale from the preference settings?

    Moved
    3
    0 Votes
    3 Posts
    731 Views
    ferdinandF
    Hello @rownn, without any further questions or replies, we will consider this thread as solved by Monday the 20th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Bringing Object Tags into Xpresso Editor, via Python?

    Moved
    4
    0 Votes
    4 Posts
    673 Views
    ferdinandF
    Hello @Expresso-Mechanic, without any further questions or replies, we will consider this thread as solved by Monday the 20th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Getting Render Progress

    s24 python
    5
    0 Votes
    5 Posts
    767 Views
    ferdinandF
    Hello @blastframe, I must apologize, I know we took our sweet time with answering this. However, we must move on with that topic, since it has been more than fourteen days since Manuel did provide his last answer. We will consider this thread as solved by Monday the 20th and flag it accordingly. Please feel free to reopen the 'Ask-as-question' status when there are questions left. Thank you for your understanding, Ferdinand
  • 0 Votes
    3 Posts
    477 Views
    D
    Hello Maxime, first of all, thanks for the quick response. You gave me a great clue with the compiled dll version. C4D R23 is compatible with scipy 1.4.0 so the solution was to downgrade it. Thanks again, Daniel
  • Stop automatic rename of objects script.py

    Moved
    12
    0 Votes
    12 Posts
    2k Views
    P
    Oh my god, thank you!!! Now material exchange does work properly again. Without this, it's just a mess to get rid of all .1, .2, .3, before I could execute the mat exchange. What a great helper, should be integrated really... Thank you very much and have a nice day
  • c4d.BFH_LEFT is not work in menu line?

    s24 python
    3
    1
    0 Votes
    3 Posts
    347 Views
    gheyretG
    @ferdinand Thanks to your replay, Some of the features I wanted seemed to be addressed in the R25! Let's rock and roll for R25! Cheers!
  • preset children of objects?

    Moved
    5
    0 Votes
    5 Posts
    708 Views
    JH23J
    Hi Thank you for solving my question, and thank you very much also for the advice.
  • BaseDraw::DrawTexture alpha issue

    r20 r21 c++
    5
    1
    0 Votes
    5 Posts
    836 Views
    C4DSC
    @m_magalhaes [image: 1631562541042-gradients.png] Did some more testing, using the original code and the conversion code, with linear workflow on and off. When I look at the original code with linear workflow OFF, this most resembles the gradient from Photoshop. Except for the gap at the top .. obviously. The result from conversion code with linear workflow ON is what I am using now, as this provides the smallest gap. And to my eyes that result looks the most linear.
  • Getting materials from Asset browser

    2
    0 Votes
    2 Posts
    500 Views
    ferdinandF
    Hello @krfft, thank you for reaching out to us. And please excuse the delay, but we did decide to wait with our answer for the all new and shiny R25 release. The new R25 C++ documentation does include the first part for an Asset API Handbook which contains most of the basics, i.e., how to iterate over stuff, how to create some basic asset types and so on, other topics will be dealt with at a later point. Some, but not all examples given there will translate directly to S24, because some parts of the Asset API have changed, as the Asset Browser is still under development. Below you will find a code snippet for finding the first ten materials in the user preferences repository which should also run under S24. Please feel free to ask follopw up questions if you have any. Cheers, Ferdinand // This code will iterate over the ten first materials that are contained in the user preferences // repository, which will contain the builtin assets of Cinema 4D as well as user databases. // The maximum number of material assets to find so that we do not saturate the console with // possibly thousands of materials that could be stored in the asset browser of a user. static Int32 g_max_object_to_find = 10; maxon::Result<void> FindAssets() { // An error scope handling which is more verbose than a simple "iferr_scope;". If one of the // calls below returns an error, the function will be exited through this block. iferr_scope_handler { ApplicationOutput("Stopped FindAssets() execution with the error: @", err); return err; }; // Get the user preferences repository. For retrieving specific user database repositories, see // CreateRepositories() in asset_api_basics_databases.cpp. const maxon::AssetRepositoryRef& repository = maxon::AssetInterface::GetUserPrefsRepository(); // Now we are preparing some arguments for the call to find assets. // The asset type we are looking for. Asset types are declared in the maxxon::AssetTypes // namespace. const maxon::AssetType assetType = maxon::AssetTypes::File(); // The id of the asset we are looking for, passing an empty id will return assets with any id. const maxon::Id assetFindId = {}; // The version of the asset we are looking for, passing an empty id will return assets with any // version. const maxon::Id assetVersion = {}; // A maxon::BaseArray where we will store all found asset descriptions. maxon::BaseArray<maxon::AssetDescription> results; // There are multiple methods attached to AssetRepositoryInterface to find assets in an // repository. We use here FindAsset() which allows us to define the verion types we want // to retrieve. In this case we pass ASSET_FIND_MODE::LATEST to only find the latest version of // each asset. But we could for example also pass ASSET_FIND_MODE::ALL to find all version of an // asset. repository.FindAssets(assetType, assetFindId, assetVersion, maxon::ASSET_FIND_MODE::LATEST, results) iferr_return; ApplicationOutput("Total number of file-type assets found: @", results.GetCount()); maxon::Int counter = 0; // Iterate over the results and print out some data for the first ten material assets. for (maxon::AssetDescription assetDescription : results) { // Exit when we encountered ten object assets. if (counter == g_max_object_to_find) break; // We retrieve the subtype of the subtype asset. See the topic Asset API - Metadata for more // details on asset metadata. maxon::AssetMetaData metadata = assetDescription.GetMetaData(); maxon::Id subTypeId = metadata.Get(maxon::ASSETMETADATA::SubType) iferr_return; // This asset is of subtype material. if (subTypeId == maxon::ASSETMETADATA::SubType_ENUM_Material) { // Now we collect some data to print out. // The id of the asset itself. maxon::Id assetId = assetDescription.GetId(); // Rather pointless here, because we know the repository in this case already, but an // AssetDescription has a the id of the repository attached it is contained in. maxon::Id repositoryId = assetDescription.GetRepositoryId(); // The storage Url of the asset. const maxon::Url& assetUrl = assetDescription.GetUrl() iferr_return; // The name of the asset. maxon::String assetName = assetDescription.GetMetaString(maxon::OBJECT::BASE::NAME, maxon::LanguageRef()) iferr_return; ApplicationOutput("Found object asset with the id: @", assetId); ApplicationOutput("\tRepository: @", repositoryId); ApplicationOutput("\tLocation: @", assetUrl); ApplicationOutput("\tName: @", assetName); counter++; } } return maxon::OK; }