Midtown Madness2 road plugin

ZModeler2 Software Development Kit forum. Programming questions and answers.

Moderator: Oleg

annabelledodd
Posts: 1
Joined: Tue Jul 08, 2014 6:41 pm
Contact:

Midtown Madness2 road plugin

Post by annabelledodd »

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?
User avatar
Oleg
Site Admin
Posts: 14662
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Midtown Madness2 road plugin

Post by Oleg »

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: 14662
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Midtown Madness2 road plugin

Post by Oleg »

moved to "ZModeler2: SDK" subforum
Post Reply