how to get view select range?

 
 
 
Posted by:SITT
Data created:7 May 2010

like this image

what method?

select range on view

You need to specify render region in CurRendererRenderFrame, here's the excerpt from SDK help:

virtual int Interface::CurRendererRenderFrame TimeValue  t,


Bitmap bm,


RendProgressCallback prog = NULL,


float  frameDur = 1.0f,


ViewParams vp = NULL,


RECT *  regionRect = NULL

[pure virtual]
 

 

Remarks:
This method is called to render a frame to the given bitmap. The renderer uses the width, height, and aspect ratio of the specified bitmap to control the size of the rendered image.
Parameters:
TimeValue t

The time to render the image.

Bitmap *bm

The bitmap to render to. This bitmap defines the size and aspect ratio of the render. See Class Bitmap.

RendProgressCallback *prog=NULL

The RendProgressCallback is an optional callback. See Class RendProgressCallback.

float frameDur = 1.0f

This parameter should always be set to 1.0.

ViewParams *vp=NULL

This parameter allows you to specify a different view transformation on each render call. For instance, you can render a given scene at a given time from many different viewpoints, without calling Render::Open() for each one.

RECT *regionRect = NULL

This value, if passed, defines the region to be rendererd. This only works for RENDTYPE_REGION and RENDTYPE_REGIONCROP.
Returns:
The result of the render - Nonzero if success; otherwise 0.

Marsel Khadiyev (Software Developer, EPHERE Inc.)

thanks,i know rendType enum

i would,can pressed and move mouse,get this action  range

i want to do like this MaxScript,

-----------------------------------

tool SelectViewRange
(
    local StartPos,EndPos
    on mouseMove clickno do
    (
        if StartPos == undefined do StartPos = ViewPoint
        EndPos = ViewPoint
    )
    on stop do #(StartPos.X,StartPos.Y,EndPos.X,EndPos.Y)
)
StartTool SelectViewRange NumPoints:1

O_o o_O

This MaxScript can convert to max.net code

It would be a lot more complicated with SDK (need to push a new command mode and implement the mouse callbacks). If you can just execute that maxscript code using ExecuteScript(...)

Marsel Khadiyev (Software Developer, EPHERE Inc.)