PDA

View Full Version : extended helper problem


marktsang
05-12-2007, 12:49 PM
hey,
i am trying to create some custom helper objects, thats all working fine - i am extending the point helper. the problem is my fps vastly suffers even with simple meshes as the display mesh, if i use the same meshes not displayed as helpers i get 400fps, with the same mesh pluged into the
"on getdisplaymesh" handler in the extended plugin (i am using a createinstance of the mesh)
my fps drops to 25fps..... its a big drop in performance


plugin Helper extendedhelper
name:"extended helper"
classID:#(0x2c380442, 0x28853918)
category:"test"
extends:point
replaceUi:true
(
local meshObj

parameters testparams rollout:displayroll
(
Length type:#float default:1.0 animatable:false
Width type:#float default:1.0 animatable:false
Height type:#float default:1.0 animatable:false
displaymesh type:#boolean ui:chk_displaymesh default:true animatable:false

on displaymesh set state do
(
if state == false then meshobj = trimesh()
if state == true then
(
meshobj = createinstance box length:length width:width height:height
)--end if state
)--end on
)--end
rollout displayroll "test rollout"
(
checkbox chk_displaymesh "Display" default:true
)--end rollout

on getDisplayMesh do
(
if (meshObj == undefined) do
(
meshobj = createinstance box length:length width:width height:height
)--end if
meshObj.mesh
)--end on
tool create
(
) --end create
)--end pluin

does anyone know why performance is so bad here?

cheers,
mark

CGTalk Moderation
05-12-2007, 12:49 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.