• BaseDraw::DrawTexture alpha issue

    r20 r21 c++
    5
    1
    0 Votes
    5 Posts
    983 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
    550 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; }
  • Overriding arrow keys in the Object Manager?

    r23 python
    9
    0 Votes
    9 Posts
    2k Views
    ManuelM
    @cairyn said in Overriding arrow keys in the Object Manager?: I guess they didn't make the cut at all...) Good guess, there's no particular reason for not being there.
  • can I have a callback when I close the c4d?

    8
    0 Votes
    8 Posts
    1k Views
    kbarK
    You should definitely be using the built in language system that C4D has. You have string files in your resource folder. One for each language that you want to support. Then C4D handles all this for you and will use the appropriate string file depending what language C4D is set to use (which you change via the preferences->Interface section). This is what @ferdinand posted already above, I just wanted to re-iterate this.
  • Mouse Over Generator Object, no position info

    6
    0 Votes
    6 Posts
    1k Views
    E
    @m_magalhaes Manuel you hero! That was it! DeformedPolygonCacheIterator was the key! Thank you so much!
  • ScrollGroupBegin() is not work in GeUserArea()

    python s24
    7
    0 Votes
    7 Posts
    953 Views
    gheyretG
    @ferdinand I will handle it. Thanks for your help! Cheers~
  • Python SSL error

    Moved python r20
    9
    0 Votes
    9 Posts
    2k Views
    orestiskonO
    @m_adam Thanks Maxime, I'll check that out. The customer was using R23.110
  • Creating "Objects" on Python tag

    python
    3
    0 Votes
    3 Posts
    680 Views
    orestiskonO
    @m_adam That clears it up, thanks Maxime!
  • Sampling an Effector

    r20 c++ sdk
    5
    0 Votes
    5 Posts
    976 Views
    ferdinandF
    Hello @d_schmidt, without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Issue with Python MultiProcessing in 24

    3
    0 Votes
    3 Posts
    715 Views
    ferdinandF
    Hello @conductor, without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Add a GUI button

    4
    0 Votes
    4 Posts
    1k Views
    ferdinandF
    Hello @stereo_stan, without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly. Thank you for your understanding, Ferdinand
  • How to detect a document switching?

    python r23 s24 sdk
    5
    0 Votes
    5 Posts
    1k Views
    ferdinandF
    Hello @mocoloco, without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Apply Substance Preset with no User Input.

    Moved
    5
    0 Votes
    5 Posts
    791 Views
    ferdinandF
    Hello @janine-mcmaster, without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Add button to run a script

    12
    0 Votes
    12 Posts
    3k Views
    ferdinandF
    Hello @stereo_stan, without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly. Thank you for your understanding, Ferdinand
  • MoData Rotations

    5
    0 Votes
    5 Posts
    981 Views
    ferdinandF
    Hello @RenatoT, without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Detect Menu/Manager while hovering...

    python maxon api classic api
    4
    1
    0 Votes
    4 Posts
    1k Views
    ferdinandF
    Hello @lasselauch, without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Where to find .res documentation?

    3
    0 Votes
    3 Posts
    671 Views
    orestiskonO
    @m_magalhaes Thanks Manuel!
  • 0 Votes
    7 Posts
    831 Views
    ThomasBT
    @m_magalhaes yes thanks that was my idea, too , I created a temporary object, in my case a spline with 0 points and 0 segments and simply exchanged it, thanks.....
  • Python: possible to check if a description is highlighted in AO?

    Moved
    3
    1
    0 Votes
    3 Posts
    662 Views
    R
    thanks.
  • 0 Votes
    5 Posts
    547 Views
    chuanzhenC
    @m_adam Thanks