Midtown Madness2 road plugin

ZModeler2 Software Development Kit forum. Programming questions and answers.

Moderator: Oleg

Midtown Madness2 road plugin

Postby annabelledodd » Tue Jul 08, 2014 6:47 pm

I decided to use the 'built-in' nodes browser, and instead use a context menu action to select whether or not to generate roads on the selected spline. The float window will only show some properties for the currently selected spline.

I got a context menu tool to work, but it should only be visible on spline objects. Can I determine the type of object inside queryLayout()?

Also, should this topic be moved because it is no longer about ZModeler 1?
annabelledodd
 
Posts: 1
Joined: Tue Jul 08, 2014 6:41 pm

Re: Midtown Madness2 road plugin

Postby Oleg » Wed Jul 09, 2014 8:11 am

Inside queryLayout(... scene::INode* pNode ...)

you can use the following:

Code: Select all
ZPtr<scene::ISplineNode> pSplineNode;

if (ZRESULT_OK == pNode->QueryInterface(IID_(scene::ISplineNode), (void**)&pSplineNode))
{
  //given object is a spline;
  //ensure you can/need your toolbox on this node

  return ZRESULT_OK; //accept tool appearance inside context menu:
}

return ZRESULT_FALSE; //node does not suit for your tools;

User avatar
Oleg
Site Admin
 
Posts: 7692
Joined: Fri Feb 06, 2004 3:54 am

Re: Midtown Madness2 road plugin

Postby Oleg » Wed Jul 09, 2014 8:12 am

moved to "ZModeler2: SDK" subforum
User avatar
Oleg
Site Admin
 
Posts: 7692
Joined: Fri Feb 06, 2004 3:54 am


Return to SDK (Software Development Kit)

Who is online

Users browsing this forum: No registered users and 1 guest

cron