[Bf-committers] Running Blender from Command Line skips Auto Execution of Driver Scripts

Campbell Barton ideasman42 at gmail.com
Wed Jul 9 07:24:45 CEST 2014


Not sure what the question is then? whats `preferred` is a bit vague,
if you know the origin of files and trust them, you can change your
preferences too.

On Wed, Jul 9, 2014 at 3:22 PM, Chris Lee <infin8eye at gmail.com> wrote:
> As I am not a programmer I do not know if adding "-y" to the command line,
> or using "use_scripts_auto_execute" in the python script is the preferred
> solution.
> I did seem to get the result I need from using "-y".
>
> Kind Regards,
> Chris "*Chips*" Lee
> Mobile: 0410155111
>
> Infin8eye <http://infin8eye.carbonmade.com/>
> Knight of the DLF
> IGDA Sydney founding member
>
>
> On 9 July 2014 15:19, Chris Lee <infin8eye at gmail.com> wrote:
>
>> Thank you for the advice, both on CLI and concrete info to be supplied for
>> a help request. I am new here.
>> Hi, by the way.
>>
>>    1. What I did on Monday does appear to be the solution I need.
>>    2. What I supplied in my post was a breakdown of what I did.
>>    3. What I am looking for input regarding the solution I found, in case
>>    I have missed something.
>>    4. Also, is it a bug? That the Auto Execute scripts are not running
>>    from command line, when the option is selected and saved in the file, to
>>    run Auto Execute scripts on start.
>>
>> For exact reference:
>>
>>    - I was running this command: "C:\Program Files\Blender
>>    Foundation\Blender\blender.exe"  F:\mport\scanimport\avatar.blend -P
>>    "F:\mport\scanimport\new avatar.py" "F:\mport\scanimport\\".  Adding '-y'
>>    at the end solved the issue. I have yet to get confirmation from my
>>    programmer that it runs well in his system for what he is trying to do, but
>>    it worked on my machine. The script he is running will move control points
>>    on a human avatar to match body scan data. What I set up in drivers will
>>    adjust the head size and height based on the neck height.
>>    - The output I was getting that was messed up by the drivers not auto
>>    running it's script was to have the head scaled down:
>>    https://www.dropbox.com/s/mu7hex3r0rb2hkd/Screenshot%202014-07-09%2015.14.02.png
>>    - The correct output, which I got from adding '-y' is:
>>    https://www.dropbox.com/s/mu7hex3r0rb2hkd/Screenshot%202014-07-09%2015.14.02.png
>>
>>
>> Kind Regards,
>> Chris "*Chips*" Lee
>> Mobile: 0410155111
>>
>> Infin8eye <http://infin8eye.carbonmade.com/>
>> Knight of the DLF
>> IGDA Sydney founding member
>>
>>
>> On 9 July 2014 14:43, Campbell Barton <ideasman42 at gmail.com> wrote:
>>
>>> When asking for help its good to give some concrete info.
>>>
>>> - the exact commands you tried.
>>> - the output you got.
>>> - the output you want/expected.
>>>
>>>
>>> On Wed, Jul 9, 2014 at 2:06 PM, Chris Lee <infin8eye at gmail.com> wrote:
>>> > I was advised I may be able to get a definitive answer here. I was
>>> trying
>>> > to solve this issue on Monday and I think I did. I would like input
>>> about
>>> > what I found and whether or not this is a bug in Blender or intended
>>> > behaviour.
>>> >
>>> >
>>> -----------------------------------------------------------------------------------
>>> >
>>> > Basically Blender normally allows you to have drivers that contain auto
>>> run
>>> > scripts, such as what I have done.
>>> >
>>> > Recently it was pointed out as a security vulnerability, that opening an
>>> > untrusted file from the web, could run a hidden python script on the
>>> user's
>>> > machine without them knowing.
>>> >
>>> http://blender.45788.x6.nabble.com/Please-turn-off-Auto-Run-Python-Scripts-by-default-td108971.html
>>> >
>>> > So by default it is now disabled, but there is an option in the user
>>> > preferences to enable it by default.
>>> > Here, under Auto Execution:
>>> >
>>> https://www.dropbox.com/s/vtxkg5f48mmfy40/Screenshot%202014-07-09%2013.25.34.png
>>> >
>>> > It appears though that there is an oversight, and running a command line
>>> > blender instance, will do so before the auto execute option is enabled.
>>> > Which means the script my programmer wrote will open Blender and run
>>> > through it's process, but the drivers will not work, that I had put in
>>> > place to control an object related to another object, controlled by the
>>> > script.
>>> >
>>> > So as mentioned here, you can force scripts to run using -y at the end
>>> of
>>> > the command prompt:
>>> >
>>> http://blender.stackexchange.com/questions/7673/auto-run-scripts-security-options
>>> >
>>> > I had also followed the link within Blender regarding Auto Execution.
>>> > I followed the link to here:
>>> >
>>> http://www.blender.org/documentation/blender_python_api_2_70_release/bpy.types.UserPreferencesSystem.html#bpy.types.UserPreferencesSystem.use_scripts_auto_execute
>>> >
>>> > So I don't know if this may help within a command line run blender
>>> python
>>> > script if -y is not used:
>>> > "use_scripts_auto_execute"
>>> >
>>> >
>>> -----------------------------------------------------------------------------------
>>> >
>>> > On Monday absolutely nobody I talked to online could advise me (apart
>>> from
>>> > the kind chap who suggested I check the mailing list, and that it had
>>> come
>>> > up in another thread here). Partly because I am in Sydney Australia and
>>> all
>>> > of Europe would have been asleep, so irc was quiet. I am hoping that
>>> > somebody here actually knows how this works.
>>> >
>>> > Please get back to me with your thoughts.
>>> >
>>> > Kind Regards,
>>> > Chris "*Chips*" Lee
>>> > Mobile: 0410155111
>>> >
>>> > Infin8eye <http://infin8eye.carbonmade.com/>
>>> > Knight of the DLF
>>> > IGDA Sydney founding member
>>> > _______________________________________________
>>> > Bf-committers mailing list
>>> > Bf-committers at blender.org
>>> > http://lists.blender.org/mailman/listinfo/bf-committers
>>>
>>>
>>>
>>> --
>>> - Campbell
>>> _______________________________________________
>>> Bf-committers mailing list
>>> Bf-committers at blender.org
>>> http://lists.blender.org/mailman/listinfo/bf-committers
>>>
>>
>>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers



-- 
- Campbell


More information about the Bf-committers mailing list