Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. Danchyg1337
    3. Best
    • Profile
    • Following 0
    • Followers 0
    • Topics 16
    • Posts 43
    • Best 3
    • Controversial 0
    • Groups 0

    Best posts made by Danchyg1337

    • Cinema 4D R20 plugin's conflict with Redshift

      Hello!
      My plugin is conflicting with Redshift 3.0.20. Cinema 4D loads infinitely until i disable Redshift, then it loads and plugin works.
      alt text
      Commandline.exe doesn't show any error, each plugin loaded.
      Project was compiled with Visual Studio 2017 v141 std17 in Release, Windows 10. Plugin has it's own unique ID from plugincafe.
      How can i find out where conflicting part is?

      posted in Cinema 4D SDK r20 c++
      Danchyg1337D
      Danchyg1337
    • Isoparm in Deformer plugin

      Hello! I have a problem with my deformer plugin.
      Plugin not only deforms shape of an object, but also adds new polygons and points to it.
      Problem appears when i try to use isoparms mode.
      What i figured out:
      Problem was in SendModelingCommand(). It was solved by making new document, executing passes and copy to original object.

      Bool DeformerPlugin::Disconnect(BaseObject* main, BaseThread* thread) {
      	BaseSelect* select = ToPoly(main)->GetPolygonS();
      	select->DeselectAll();
      	AutoAlloc<BaseDocument> basedocBuffer;
      	BaseObject* clonedOp = (BaseObject*)main->GetClone(COPYFLAGS::NONE, nullptr);
      	basedocBuffer->InsertObject(clonedOp, nullptr, nullptr);
      	basedocBuffer->ExecutePasses(thread, true, true, true, BUILDFLAGS::INTERNALRENDERER);
      	ModelingCommandData mcd;
      	BaseContainer bc;
      	bc.SetData(MDATA_DISCONNECT_PRESERVEGROUPS, false);
      	mcd.doc = clonedOp->GetDocument();
      	mcd.op = clonedOp;
      	mcd.mode = MODELINGCOMMANDMODE::POLYGONSELECTION;
      	mcd.flags = MODELINGCOMMANDFLAGS::NONE;
      	mcd.bc = &bc;
      
      	if (!SendModelingCommand(MCOMMAND_DISCONNECT, mcd)) {
      		ApplicationOutput("Disconnect error.");
      		return false;
      	}
      	clonedOp->CopyTo(main, COPYFLAGS::NONE, nullptr);
      	clonedOp->CopyMatrixTo(main);
      	clonedOp->CopyTagsTo(main, NOTOK, NOTOK, NOTOK, nullptr);
      	return true;
      }
      

      I should mention that plugin works well with polygon mesh objects and problem appears only with generator objects in isoparm mode.
      I guess problem is in Isoparm lines. I've tried to use BUILDFLAGS::ISOPARMS. I cannot use it with non-generator plugin. But i saw few plugins that change count of polygons and still work good. And due to my logic in code i cannot change plugin type to generator.

      Although creating a temporary document has been a solution, it still doesn't work good. Cinema4d crash appears randomly while i'm testing it. Usually it happens when i reduce amount of detail, i guess it is something with caches.

      What isoparms even are? Why should i use it and how to prevent cinema from crash?
      And what about SetIsoparm()? Can i use it in deformer plugin somehow? And should i?

      posted in Cinema 4D SDK r20 c++ r21
      Danchyg1337D
      Danchyg1337
    • RE: TreeView Multiple Selection With LMB

      @m_adam Maybe i'm little misunderstood you. I meant not exactly third case. But a case, when you start holding your mouse at empty space and selecting objects with outcoming rectangle.

      posted in Cinema 4D SDK
      Danchyg1337D
      Danchyg1337