Page 1 of 1

Midtown Madness2 road plugin

PostPosted: Tue Jul 08, 2014 6:47 pm
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?

Re: Midtown Madness2 road plugin

PostPosted: Wed Jul 09, 2014 8:11 am
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;


Re: Midtown Madness2 road plugin

PostPosted: Wed Jul 09, 2014 8:12 am
by Oleg
moved to "ZModeler2: SDK" subforum