• Phong Tag with ObjectData

    python
    6
    0 Votes
    6 Posts
    1k Views
    ?
    It's working! Thank you @zipit , @r_gigante , & @m_adam ! Have an excellent weekend. A note for future readers One issue with my demo code is I wasn't passing the op from GetVirtualObjects to the CreateMyObject method. @m_adam created a new object (newObj) and only calls GetTag on the op (variable name: node). phongTag = node.GetTag(c4d.Tphong)
  • Error reading resource Line 1

    r20 c++ python windows
    3
    0 Votes
    3 Posts
    1k Views
    B
    After a LOT of testing around I finally found the culprit. The header file was encoded UTF-8 with BOM. I finally figured it out after noticing that two versions of the header file that worked or didn't work had a 3 byte difference in file size. No idea how that snuck in there, but now it finally works. Also now it makes sense that the error was pointing to line 1.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Polygon Selections with ObjectData Plugin

    python
    6
    1
    0 Votes
    6 Posts
    877 Views
    ?
    @zipit Sorry, it embarrassingly didn't occur to me that your file example was working because I didn't see the Selection Tags as with the Generators. Thanks again for it! For the best user experience, there would be a proxy tag so the user can link & reference it by name. @m_magalhaes , any updates on the SetRealTag implementation in the SDK? I created a request for the SDK here: SetRealTag Request Thank you.
  • Ignore Javascript on Windows ?– CUSTOMGUI_HTMLVIEWER

    python sdk windows
    6
    0 Votes
    6 Posts
    1k Views
    M
    Hi @lasselauch sorry for the late reply, I asked about the developer responsible for it. On Windows we use the WebView control of the last iteration of iexplore MS shipped for 8.1 - Internet Explorer 11 (user-agent ID: "Trident"). It supports >most< things other modern browsers do, but sadly not everything... Especially the JS support has become a problem since IE11 is missing parts of the ECMA 6 standard and needs 'polyfills' to emulate those. Many JS frameworks / libraries don't offer IE11 compatibility and instead rely on the developer to add those polyfills themselves. One of the improvements IE11 received back then was the developer console+tools so the user could use those to track > down the JS issues and resolve them." I also forwarded your request about the ability to disable Javascript, but so far nothing planned atm, so the only workaround I see is either fix your javascript framework (maybe a huge task) or you can disable your javascript based on the user agent and if it's an IE11. Hope this help, Cheers, Maxime.
  • Adding camera calibration lines by script?

    3
    0 Votes
    3 Posts
    712 Views
    CairynC
    ok, thanks for the confirmation!
  • Remove a GeDialog Tab Group

    python
    3
    0 Votes
    3 Posts
    775 Views
    ?
    @m_adam I'm good with using Python this way. Thanks Maxime.
  • Changing assets paths - Feature request

    4
    0 Votes
    4 Posts
    1k Views
    J
    Hi @r_gigante, Would still love if you guys can create something that enabled you to change assets paths with python. Hopefully it can be added to the feature list. Thank you.
  • Access C4D Objects outside C4D?

    r21 python
    10
    0 Votes
    10 Posts
    1k Views
    M
    VS Code and Sublime Text are not so well designed and simply spawn a bunch of python interpreters to retrieve the information they need, In contrast, pycharm does use only one and the same python interpreter its spawn. So that's why you got these issues.
  • RDATA_PATH not working with Render Settings

    r23 python
    3
    1
    0 Votes
    3 Posts
    477 Views
    M
    Hi @blastframe as demonstrated in tokensystem_render_r17.py you should always operate on the BaseContainer. Cheers, Maxime.
  • Radio button groups in two columns

    Moved
    6
    0 Votes
    6 Posts
    1k Views
    S
    Hi Maxime, it now works great, thank you very much for your support! Cheers, Stan
  • Compare only parts of two BaseContainers()

    r20 r21 s22 r23 c++
    6
    0 Votes
    6 Posts
    709 Views
    fwilleke80F
    Nice, Manuel, thank you! I guess, I'll try the SetDParameter() approach, too, in good time. Cheers, Frank
  • Emojis - macOS vs. Windows

    4
    3
    0 Votes
    4 Posts
    2k Views
    CairynC
    why do you think C4D has any special handling for emojis? The font rendering is OS dependent, so any kind of text - including emoji codepoints - is drawn by the underlying operating system routines. Anything else would mean a ridiculous effort by Maxon to replicate font behavior. (I do not know how Windows internally handles emojis, I doubt that every available font has all these characters so most likely certain codepoints are mapped to common glyphs regardless of the font... but that is not a C4D question anyway.)
  • I need help with this Python code

    Moved
    3
    0 Votes
    3 Posts
    541 Views
    M
    Without more information, from your side, I've set up your topic as solved but feel free to re-open it. Cheers, Maxime.
  • 0 Votes
    3 Posts
    745 Views
    M
    Without more information, from your side, I've set up your topic as solved but feel free to re-open it. Cheers, Maxime.
  • Select several files in LoadDialog()

    r21 python
    3
    0 Votes
    3 Posts
    381 Views
    B
    @r_gigante Ah gotcha. Thanks for the confirmation.
  • What is Vector.GetLengthSquared() really meant for?

    r21 python
    5
    0 Votes
    5 Posts
    1k Views
    CairynC
    @zipit said in What is Vector.GetLengthSquared() really meant for?: My major point was that there are certain programming assumptions (multiplication is better than division, never take the square root if avoidable, cubic complexity is uncomputable, etc.) that should be taken with a grain of salt due to the fact that they rely on a certain "state" of hardware. I.e. all these three do not really hold true anymore to the extent they once did. (...) That goes without saying... ultimately, any effort towards optimization needs to be checked for effectivity. Nevertheless, I was curious and abused a plugin of mine to execute some timer checks in C++, just for comparison (code excerpt only): using namespace std::chrono; Vector v(100.0, 100.0, 100.0); float f; milliseconds ms1, ms2, diff; ms1 = duration_cast<milliseconds>( system_clock::now().time_since_epoch() ); for (int i = 0; i < 100000000; i++) { f = 0; // v.GetLength(); } ms2 = duration_cast<milliseconds>( system_clock::now().time_since_epoch() ); diff = ms2 - ms1; GePrint(maxon::String("Time counter Empty:") + maxon::String::IntToString(diff.count())); ms1 = duration_cast<milliseconds>( system_clock::now().time_since_epoch() ); for (int i = 0; i < 100000000; i++) { f = v.GetLength(); } ms2 = duration_cast<milliseconds>( system_clock::now().time_since_epoch() ); diff = ms2 - ms1; GePrint(maxon::String("Time counter GetLength:") + maxon::String::IntToString(diff.count())); ms1 = duration_cast<milliseconds>( system_clock::now().time_since_epoch() ); for (int i = 0; i < 100000000; i++) { f = v.GetSquaredLength(); } ms2 = duration_cast<milliseconds>( system_clock::now().time_since_epoch() ); diff = ms2 - ms1; GePrint(maxon::String("Time counter GetSquaredLength:") + maxon::String::IntToString(diff.count())); Switching off all optimizations, I get (for multiple button presses): Time counter Empty:185 Time counter GetLength:921 Time counter GetSquaredLength:228 Time counter Empty:184 Time counter GetLength:922 Time counter GetSquaredLength:228 Time counter Empty:183 Time counter GetLength:921 Time counter GetSquaredLength:228 Time counter Empty:183 Time counter GetLength:922 Time counter GetSquaredLength:228 Time counter Empty:185 Time counter GetLength:921 Time counter GetSquaredLength:228 Time counter Empty:183 Time counter GetLength:921 Time counter GetSquaredLength:227 That is far more like what I expected (double so if you consider that the loop with a constant assignment already takes 185ms). Considering that I had to up the loop count to a hundred million to get measurable results, it is practically guaranteed that any difference between GetLength and GetLengthSquared in the Python sample is drowned in the Python interpreter's overhead, and any result from my initial tests must be attributed to sheer randomness.
  • UVW values inconsistency

    r21 s22 c++ python
    4
    0 Votes
    4 Posts
    1k Views
    rsodreR
    @r_gigante good to know, thanks!
  • Edge To Spline Modeling Command

    sdk r20 c++
    3
    0 Votes
    3 Posts
    1k Views
    J
    Thanks for the response, that was exactly what I needed. John Thomas
  • CloseDocument ?

    2
    0 Votes
    2 Posts
    512 Views
    CairynC
    Just check it manually: if currDoc.GetChanged() : c4d.gui.MessageDialog(c4d.plugins.GeLoadString(IDS_MSG_PROJECTCHANGED)) else : c4d.documents.KillDocument(currDoc) # works but ignores change status