Metasequoia BBS

| 新規投稿 | 通常表示 | ツリー表示 |
状態
タグ
キーワード
[9766] metasequoia script editor "deleteObject" not work / Tga
[質問] 返信
When I used this example, the function MQSystem.getDocument().deleteObject(x) didn't delete the cache of objects that every time I run the code, the number of objects are accumulated and make the window lagged.
Is it possible to fix this problem?
Is there a code similar to AllObject.Clear()?
------------------------------------------------
import random
doc = MQSystem.getDocument()
out = MQSystem.println

for x in range(0, MQSystem.getDocument().numObject):
    MQSystem.getDocument().deleteObject(x)


def p(*args):
  if len(args)==0:
    MQSystem.println("")
    return
  for arg in args:
    MQSystem.println(str(arg))

#drawCube_def_metal.py

続きを表示...
2023-07-03 01:48
[9767] Re: metasequoia script editor / Tga
I know I can just open a new project to do it, but sometimes in some situations I need to do it by scripting.
2023-07-03 01:56
[9768] Re: metasequoia script editor / Tga
I found doc.compact() does delete None objects, but in the canvas, old cube caches still on there, and make the app being lagged for each Compilation.
2023-07-03 03:13
[9769] Re: metasequoia script editor / Tga
after remove codes of material part, deleteObject with doc.compact() works fine.
Problem solved.
2023-07-03 03:39
[9771] Re: metasequoia script editor / 管理者
It seems that you have already found a solution, but in any case there is a slight problem with the update process in the deleteObject() function.
We will resolve this issue in the next release.
2023-07-05 12:40