Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

CURRENTSTATETOOBJECT of a Null

 Post Reply Post Reply
Author
Message
pgrooff View Drop Down
Member
Member


Joined: 2010 Nov 05
Online Status: Offline
Posts: 693
Post Options Post Options   Quote pgrooff Quote  Post ReplyReply Direct Link To This Post Topic: CURRENTSTATETOOBJECT of a Null
    Posted: 2017 Jun 02 at 3:22am

User Information:

Cinema 4D Version:   R16 
Platform:   Windows  ;   
Language(s):     C++  ;   

---------

I am still struggling with the SendModelingCommand()+MCOMMAND_CURRENTSTATETOOBJECT.

A standard Sphere is ok, but wat to do with a Null.
Are there issues or things to check when CST a Null?

Here my code.
ModelingCommandData cd;
cd.doc = GetActiveDocument();
//cd.op = (BaseObject*)obj->GetClone(COPYFLAGS_NO_BITS, nullptr);
cd.op = obj; //Do not Clone!!!
if (!SendModelingCommand(MCOMMAND_CURRENTSTATETOOBJECT, cd)) return false;
cstObject = (BaseObject*)cd.result->GetIndex(0);
if (!cstObject) return nullptr;
 
-Pim
Back to Top
pgrooff View Drop Down
Member
Member


Joined: 2010 Nov 05
Online Status: Offline
Posts: 693
Post Options Post Options   Quote pgrooff Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Jun 02 at 3:40am
Found it.
I did not take the correct document (virtual / cache object);

//cd.doc = GetActiveDocument();
cd.doc = obj->GetDocument();

-Pim
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.102 seconds.