I want to update a particle flow shape instance with maxscript.

I want to update a particle flow shape instance with maxscript.

Anonymous
Not applicable
1,025 Views
2 Replies
Message 1 of 3

I want to update a particle flow shape instance with maxscript.

Anonymous
Not applicable

I'm trying to write a script that corresponds to the Update Particle Shape button.
It does n’t work. Is there a good way?

0 Likes
Accepted solutions (1)
1,026 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

By the way, I want to update the assigned material.

Even if you turn on / off the Acquire_Material of the shape instance, it will not be updated.

To be precise, it will not work if written in a function or dialog.

0 Likes
Message 3 of 3

Anonymous
Not applicable
Accepted solution

This has been resolved. It was the effect of undo off defined in the running ui. 

Set the function used below.

 

fn pf_source_shapeins=(
print "pf_source shape ins"
selll = (execute"selection as array")

gtcmp = getCommandPanelTaskMode()
buttonnames = #("パーティクル シェイプを更新","Update Particle Shape")

max modify mode

for ob in (execute"objects as array") do(
if classof ob.baseobject == Shape_Instance do(
select ob
maxChildren = windows.getChildrenHWND (windows.getMaxHWND())
trfl = false
for child in maxChildren while trfl == false do(
fnds = finditem buttonnames child[5]
if fnds > 0 do(
UIAccessor.pressButton child[1]
trfl = true
)
)
)
)
setCommandPanelTaskMode gtcmp
clearSelection()
select selll
)

0 Likes