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?
Solved! Go to Solution.
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.
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
)
Can't find what you're looking for? Ask the community or share your knowledge.