Log In
New Account
Home My Page Projects Blender 2.x BF release
Summary Activity Tracker SCM Files

Blender 2.6 Bug Tracker: Browse

[#30713] Python Particle texture mapping object affectation is working but has no effect in simulation

Date:
2012-03-29 11:40
Priority:
3
State:
Closed
Submitted by:
yann morère (ian57)
Assigned to:
Janne Karhu (jhk)
Category:
Python
Status:
Closed
Relates to:
Duplicates:
Patches:
 
Summary:
Python Particle texture mapping object affectation is working but has no effect in simulation
Detailed description
I wrote a python script to "macro" this tuto http://blenderdiplom.com/index.php/en/tutorials/item/78-tutorial-dissolve-your-logo-in-blender-262.

All is working fine when done manually with GUI.

But when i use the script, the following step halfly goes wrong :

#affect new texture
ActiveObjectText.particle_systems['ParticleSystem'].settings.texture_slots[0].texture = sTex
ActiveObjectText.particle_systems['ParticleSystem'].settings.texture_slots[0].texture_coords = 'OBJECT'
ActiveObjectText.particle_systems['ParticleSystem'].settings.texture_slots[0].object = bpy.data.objects['Plane'] #ActiveObjectPlane
ActiveObjectText.data.update()

In the blender, the "plane" is well affected in the combo box, but it has no effect when running the animation. If I scrolldown the combo a REselect manually the plane, then it works.

Another point, when copy/pasting each line from the script to python console, i have the same result in the animation as in automatic script way. But if make in the python console
ActiveObjectText.data.update()
or
bpy.data.scenes['Scene'].update()
or
another plane affectation
ActiveObjectText.particle_systems['ParticleSystem'].settings.texture_slots[0].texture_coords = 'OBJECT'
ActiveObjectText.particle_systems['ParticleSystem'].settings.texture_slots[0].object = ActiveObjectPlane

the plane effect works, and the animation is good.

I made severals tests (as you can see in the script), on 32 and 64 bits architecture, with 2.62 released, and svn compiled verion. The problem is always the same. Full reproductible.

You can find full script here : http://yann.morere.free.fr/spip/spip.php?article160

See the attached to make you're own tests

Yann

Followup

Message
  • Date: 2012-03-29 11:59
  • Sender: yann morère
  • can't upload files! Error message Parameter missing
  • Date: 2012-03-29 12:01
  • Sender: yann morère
  • Adding System info and blend file
  • Date: 2012-03-29 12:01
  • Sender: yann morère
  • Ok it worked... need to understand!
  • Date: 2012-03-30 07:25
  • Sender: yann morère
  • Peharps there is a misunderstanding. Upload worked. I didn't understood that upload mus be joined with a comment !.

    But my Blender problem still remains ;-)
  • Date: 2012-04-02 16:36
  • Sender: Sergey Sharybin
  • Assigning to Janne,

    but olease always try to find minimal case when blender does not work as expected, it helps a lot understanding what you expect to have and what in fact you've got, also saves lots of time trying to understand this things.
  • Date: 2012-04-02 20:24
  • Sender: yann morère
  • Ok, thanks a lot take into account my problem. Tomorrow, I will make a small video to help to understand the keypoint. and post the link here.

    For now, here is 2 screenshots to show where is the problem. (animation at the same frame, without and with the plane reaffectation).

    Hope this helps
  • Date: 2012-10-23 11:52
  • Sender: Ton Roosendaal
  • Hi Yann,

    In Blender code, after such actions Blender gets signals to refresh itself (update calls). These update calls are handled by the event system.
    While you run a script, events are being halted until you end the script. That is why the API has update calls too add yourself.

    I realize it is clumsy, but this is the inner working of Blender itself. People use the Python API as a full replacement for C code now, which is nice but not a specification we can guarantee to work.
  • Date: 2012-10-23 16:22
  • Sender: yann morère
  • Hi Ton , thanks for this answer. Finally I gave up and did not use this plane feature.
    I'm going to do some new test to see if it works now ;-)

    This animation has been included in Openshot Video Editor program ;-)
 

Attached Files:

Name Date Download
system-info.txt 2012-03-29 12:01 Download
dissolve_script_v6_final_transparent.blend 2012-03-29 12:01 Download
without_plane_reaffectation.png 2012-04-02 20:24 Download
with_plane_reaffectation.png 2012-04-02 20:24 Download

Changes:

Field Old Value Date By
status_idOpen2012-10-23 11:52ton
close_dateNone2012-10-23 11:52ton
StatusInvestigate2012-10-23 11:52ton
File Added19980: without_plane_reaffectation.png2012-04-02 20:24ian57
File Added19981: with_plane_reaffectation.png2012-04-02 20:24ian57
assigned_tonone2012-04-02 16:36nazgul
StatusNew2012-04-02 16:36nazgul
File Added19917: dissolve_script_v6_final_transparent.blend2012-03-29 12:01ian57
File Added19916: system-info.txt2012-03-29 12:01ian57