Friday, October 18, 2024

Day 24: Blender tutorial for making illustrations – Creating Illustrations for the Quranic Learning Series

 


  1. Choose a Quranic Concept
    Pick a concept or theme from the Quran that you want to illustrate. For example, you could create a flowchart or mind map that explains the steps of a Quranic story or a diagram illustrating a verse.
    • Example: A visual breakdown of the concept of 'Sabr (Patience)' with key points.
  2. Set Up Your Blender Workspace
    • Open Blender and start a new 2D animation project.
    • Arrange the interface for illustration by adjusting the 3D viewport, timeline, and properties panel for easy access to tools.
  3. Use Grease Pencil for Drawing
    The Grease Pencil tool is ideal for drawing diagrams.
    • Use basic shapes (circles, lines, squares) for the structure of your illustration.
    • Draw key points and nodes that represent ideas from the Quranic concept.
    • Use freehand drawing or pre-defined shapes for clarity.
  4. Add Text and Labels
    • Use the text tool to add labels to your illustrations.
    • Example: If illustrating 'Sabr', add labels such as 'Patience in Hardship', 'Trust in Allah', etc., around your visual diagram.
  5. Incorporate Quranic Arabic Text
    • To make the illustration authentic, add relevant Arabic Quranic terms or verses. Use Blender’s text tool to input the Arabic script.
    • Example: Add the word 'صبر' (Sabr) in a central position of the diagram, with explanations branching from it.
  6. Add Colors and Styling
    • Use color to differentiate between various elements. For example, use distinct colors for headings, sub-points, and explanations.
    • Apply simple shading to give your illustration a clean, polished look.
  7. Organize with Layers
    • Separate text, shapes, and lines into different layers to keep the diagram organized. This will make editing easier as the project becomes more complex.
  8. Preview and Adjust
    • Preview your work in the viewport and make any necessary adjustments to alignment, spacing, or color.
    • Ensure that the diagram is clear and that viewers can easily understand the connections between different parts of the illustration.
  9. Add Basic Animation (Optional)
    If you feel confident, animate parts of the diagram to appear one by one, guiding viewers through the concept step-by-step.
    • Example: Animate the 'Sabr' title appearing first, followed by its branches in sequence.
  10. Save and Render Your Illustration
    • Save your Blender file.
    • Render the still image or short animation as a video, depending on what you created.
  11. Voiceover Plan (For Later)
    • Write down the points you will explain when recording your voiceover. You don’t need to add the voiceover today, but prepare your script for when you combine audio with your visuals in later days.

Outcome:

By the end of today, you will have a visually appealing Quranic concept illustration, ready for further refinement and animation in upcoming days.

Source:
ChatGPT


Thursday, October 17, 2024

Post 28/30: VFX tutorial for Blender – Advanced Camera Effects (Depth of Field, Motion Blur)

 

Goal

Learn how to add cinematic effects to your renders using depth of field and motion blur in Blender.


Step-by-Step Guide

1. Setting Up Your Scene

  • Open Blender and create a new project.
  • Import or create a simple scene with objects that will be interesting when depth of field and motion blur are applied.
  • Consider including various distances and sizes of objects for a more dynamic effect.

2. Positioning the Camera

  • Select the Camera: Click on the camera in your scene or create a new one by pressing Shift + A and choosing Camera.
  • Adjust the Camera View: Press Numpad 0 to enter camera view. Use the camera settings panel (press N to toggle) to adjust the camera’s position and rotation for the best composition of your scene.

3. Enabling Depth of Field

  • Select the Camera: In the Properties panel, go to the Camera tab.
  • Enable Depth of Field: Check the box next to "Depth of Field."
  • Focus Object: Set an object in your scene as the focus object by either choosing it in the "Focus on Object" field or adjusting the "Focus Distance" slider until the desired object is sharp.
  • Adjust F-Stop: Lowering the F-Stop value will create a shallower depth of field, resulting in more pronounced blur in the foreground and background. Experiment with this setting to find the look you prefer.

4. Adding Motion Blur

  • Go to Render Properties: Select the Render tab (camera icon) in the Properties panel.
  • Enable Motion Blur: Scroll down to the Motion Blur section and check the box to enable it.
  • Adjust Settings: You can adjust the "Shutter" value to control the intensity of the motion blur. A higher shutter value will create more blur, while a lower value will reduce it.

5. Animating the Scene (Optional)

  • If you want to see the motion blur effect in action, create a simple animation:
    • Select an Object: Choose an object you want to animate.
    • Insert Keyframes: Move to frame 1, position the object, and press I to insert a keyframe. Move to frame 30 (or your desired end frame), change the object’s position, and insert another keyframe.
    • This will allow you to see the motion blur as the object moves through the scene.

6. Rendering the Scene

  • Select the Output Settings: In the Output Properties tab (printer icon), set the output resolution and file format.
  • Render the Animation: Go to Render in the top menu and select Render Animation. Blender will process your scene with the applied effects.

7. Shareable Visual

  • Once your animation is rendered, save it in a suitable format (like MP4 or AVI).
  • Share your cinematic render showcasing depth of field and motion blur on your social media or portfolio.

Tips for Success

  • Experiment with different F-Stop values and shutter settings to achieve various looks.
  • Use different camera angles to see how depth of field and motion blur affect the perception of your scene.
  • Always preview your animation before rendering to ensure everything looks as intended.

Source:
ChatGPT


Day 2: A challenge to learn basics of Structural Equation Modeling (SEM) using lavaan and semPlot packages in R

 

During the next 12 days, I will learn and repeat the basics of structural equation modeling (SEM) using lavaan and semPlot packages in R.

You can search my lavaan posts by typing: #UsmanZafarParacha_lavaan , and semPlot posts by typing: #UsmanZafarParacha_semPlot

============

During this day, initially essential libraries, including lavaan and semPlot are loaded, and model is defined. For instance, social status affects education level, education level affects political participation, and social status affects political participation. Following lines of codes can be used:

library(lavaan)

library(semPlot)

 

model <- '

  # Direct effect

  political_participation ~ social_status

 

  # Mediated effect

  education_level ~ social_status

  political_participation ~ education_level

'

 

For this analysis, a supposed data can be generated using the following codes:

 

set.seed(123)  # For reproducibility

n <- 300  # Number of observations

 

# Simulate the data

social_status <- rnorm(n, mean = 50, sd = 10)

education_level <- 0.6 * social_status + rnorm(n, mean = 0, sd = 5)

political_participation <- 0.4 * social_status + 0.7 * education_level + rnorm(n, mean = 0, sd = 5)

 

# Combine into a data frame

data <- data.frame(social_status, education_level, political_participation)

 

Then, the model is fit in lavaan, using the following lines of codes:

 

fit <- sem(model, data = data)

 

# Check the summary of the model

summary(fit, fit.measures = TRUE, standardized = TRUE)

 

Then, the model is visualized using semPlot, as follows:

 

semPaths(fit, whatLabels = "std", layout = "tree", edge.label.cex = 1.2,

         residuals = TRUE, intercepts = FALSE)

 

Eventually, the results are analyzed.

Source:
ChatGPT

Some of the factors related to increased real estate businesses in the next few months

(Source: Pixabay)

Even though Pakistan has faced economic crisis during the past several months, it will experience very good situation in the coming six months (such as up to March/April, 2025). An important reason is that IMF approved Pakistan package. It will help in stabilizing the price of dollar in the coming months. It would also help in controlling inflation rate. The interest rate has also gone down from 22% to 17%. It is expected that real estate will experience 5% to 20% increase in rate. It is also expected the electricity prices will go down. Moreover, petrol prices would also go down. New currency notes are also in designing phase, and probably by December they will be finalized, and within next four to six months they will be approved. This can also affect real estate business. For instance, in Faisal Hills, 5 marla plot is available in the price range of about 25 lacs, it would experience an increase in 2.5 to 3 lacs.

Source:

Awan Associates - Pakistan's Property Market: An In-Depth Analysis of Trends and Challenges for 2025 | Awan Associates - https://www.youtube.com/watch?v=QubORrWAvR0


Post 27/30: VFX tutorial for Blender – Character Animation Basics

Goal: Animate your rigged character by creating a simple animation, such as a walk cycle.

Step-by-Step Guide:

1.     Open Blender and Load Your Rigged Character
Open the project you worked on during Day 26 where you created the character rig. If you don't have it ready, you can quickly rig a basic character model by adding bones to control the limbs, body, and head.

2.     Set Up the Timeline

    • At the bottom of the Blender interface, find the "Timeline" window.
    • Set the frame range to match the length of the animation. For a basic walk cycle, 24 to 48 frames is a good starting point.

3.     Switch to Pose Mode

    • Select your character rig.
    • Press Ctrl + Tab or go to the menu in the top left and switch from "Object Mode" to "Pose Mode."

4.     Animate the Walk Cycle

    • Key Poses: A walk cycle generally includes key poses such as:
      • Contact Pose: The character’s foot touches the ground.
      • Passing Pose: The leg passes the other in the air.
      • Down Pose: The weight shifts onto the front foot.
      • Up Pose: The character lifts off the ground.
    • Go to the first frame (frame 1) and adjust the bones to create the contact pose.
    • Select all bones (A), then press I and choose Location & Rotation to add a keyframe.

5.     Add Keyframes for Other Poses

    • Move forward to frame 6 or 8 (depending on the speed of your walk cycle) and adjust the bones to the down pose, then keyframe it.
    • Continue this process for the passing and up poses.
    • Once you’ve reached the last frame, copy the keyframe from frame 1 to the last frame to create a seamless loop.

6.     Refine the Animation

    • Play the animation in the timeline (Space).
    • Make adjustments by selecting specific bones and refining their positions for smooth movements.

7.     Polish with In-Between Frames (Optional)

    • To add more fluidity, create in-between poses by adjusting the bones between keyframes.

8.     Test the Walk Cycle

    • Play the animation and see if it loops smoothly. Adjust timing and poses as necessary for a more natural walk.

9.     Render the Animation

    • Go to the camera view (Numpad 0) and set up a good shot of your character.
    • Set up the rendering options (choose resolution, frame rate, and output format).
    • Render the animation by going to Render > Render Animation.

10.  Shareable Visual:
Export the animation as an .mp4 file or any other preferred format, and you’ll have a short character animation ready to share!

Tips:

  • Focus on getting the timing of the walk cycle right by adjusting the keyframe intervals.
  • You can use Blender’s Graph Editor to fine-tune movements, ensuring smooth transitions between poses.

Source:
ChatGPT


Day 23: Blender tutorial for making illustrations – Introduction to Using Add-ons for Enhanced Graphics


Objective:
Today, you'll explore and use Blender add-ons to enhance the quality of your diagrams and illustrations. Add-ons are tools and features developed by the Blender community or third-party developers to expand Blender's functionality.


Step 1: Understanding Blender Add-ons

Blender has several built-in add-ons that you can activate for additional functionality. Some add-ons are designed specifically for improving graphics, drawing, or even text-based tasks. Others can help speed up your workflow by providing shortcuts or specialized tools.


Step 2: Activating Add-ons

  1. Open Blender and go to the Edit menu.
  2. Select Preferences.
  3. In the Preferences window, click on Add-ons on the left panel.
  4. Search for useful add-ons, such as:
    • "3D View: MeasureIt" for precise measurements on your diagrams.
    • "Grease Pencil Tools" for more advanced drawing tools.
    • "Text FX" for enhancing text elements with effects.
  5. Check the box next to the add-ons to activate them.

Step 3: Experimenting with an Add-on (e.g., Grease Pencil Tools)

  1. Grease Pencil Tools: After activation, you can use these to create more advanced brush strokes and drawings.
  2. Create a new project or open an existing diagram.
  3. Select the Grease Pencil tool and notice the new brushes and options that are available due to the activated add-on.
  4. Try experimenting with new brushes, line thickness, and effects.

Step 4: Enhancing Your Diagram

  1. Use the tools from the activated add-on to improve a previous diagram (like a flowchart or mind map).
    For example, using Grease Pencil, you can add unique textures or enhance visual details in your shapes.
  2. Try out MeasureIt to create precise measurements in flowcharts, especially if accuracy is essential.

Step 5: Saving and Exporting

  1. Once you're satisfied with your enhanced diagram, save your project.
  2. Export the diagram if needed by going to File > Export and selecting the format you need (e.g., PNG or video if it’s animated).

Source:
ChatGPT


Wednesday, October 16, 2024

Day 1: A challenge to learn basics of Structural Equation Modeling (SEM) using lavaan and semPlot packages in R

During the next 12 days, I will learn and repeat the basics of structural equation modeling (SEM) using lavaan and semPlot packages in R.

You can search my lavaan posts by typing: #UsmanZafarParacha_lavaan , and semPlot posts by typing: #UsmanZafarParacha_semPlot

============

During this day, I will learn about the use of SEM in Psychology (Cognitive and Behavioral Research). The example is investigating the relationship between stress, self-esteem, and academic performance. For this example, the model is that stress negatively affects self-esteem, which in turn impacts academic performance. SEM helps to model the direct effect of stress on performance, as well as the indirect effect via self-esteem. A hypothetical dataset will be used.

Initially, lavaan and semPlot packages are loaded, and a hypothetical dataset is developed, using the following lines of codes:

 

library(lavaan)

library(semPlot)

 

# Create a sample dataset

set.seed(123) # For reproducibility

n <- 100 # Number of participants

 

data <- data.frame(

  stress = rnorm(n, mean = 50, sd = 10),          # Stress scores

  self_esteem = rnorm(n, mean = 70, sd = 10),     # Self-esteem scores

  academic_performance = rnorm(n, mean = 75, sd = 10) # Academic performance scores

)

 

# Check the dataset

head(data)

 

Then, we define the relationships between the variables. For instance, stress directly affects self-esteem, self-esteem directly affects academic performance, and stress indirectly affects academic performance through self-esteem. These relationships can be written as follows:

 

# Define the SEM model

model <- '

  # Direct effects

  self_esteem ~ stress

  academic_performance ~ self_esteem

 

  # Indirect effect via self_esteem

  academic_performance ~ stress

'

Then, the lavaan function is used to fit the model, using the following lines of codes:


# Fit the SEM model

fit <- sem(model, data = data)

 

# Check the summary of the model

summary(fit, fit.measures = TRUE, standardized = TRUE)

 

The summary provides important information, including path coefficients, standard errors, p-values, and fit indices like RMSEA, CFI, and TLI.

 

Then, the results are interpreted using the summary(fit) function. For instance, Path Coefficients show the strength and direction of relationships between variables; Significance check the p-values to determine whether relationships are statistically significant; and Fit Indices show Good model fit is indicated by RMSEA < 0.06, CFI > 0.95, and TLI > 0.95.

 

Then, the model is visualized with semPlot package, using the following lines of codes:

 

# Plot the SEM model

semPaths(fit, what = "std",

         layout = "tree",

         edge.label.cex = 1.2,

         sizeMan = 6,

         sizeLat = 8)

 

The model can also be modified using the following:

# Define a new SEM model with mediation

mediation_model <- '

  # Mediation

  self_esteem ~ stress

  academic_performance ~ self_esteem

  academic_performance ~ stress

'

 

# Fit the new model

mediation_fit <- sem(mediation_model, data = data)

 

# Summary with fit measures

summary(mediation_fit, fit.measures = TRUE, standardized = TRUE)

 

# Visualize the mediation model

semPaths(mediation_fit, what = "std",

         layout = "circle",

         edge.label.cex = 1.2,

         sizeMan = 6,

         sizeLat = 8)

 

Source:
ChatGPT


Pakistan’s current economic situation and real estate market forecasting

In the Pakistani Market, people are experiencing ups and downs. The same thing happens with real estate market during the past few years. More focusedly, it can be said that people who have invested in real estate have experienced losses during the past few years. Usually, businesses are linked to stability of the country. However, recently some changes have been made in the country.

During the years from 2020 to 2022, real estate market experienced a good boom. People purchased many properties leading to an increase in the rates of properties. For instance, people have also earned up to 100% to 150% profits. However, after that country’s condition worsened and economic went down.

During 2022, banks started increasing their interest rates, and by the mid of 2023, interest rates went to about 21%. This change in interest rates lead to the placement of money in banks by investors after taking money out of all other investment options. This placement of money in banks also resulted in an increase in banks’ businesses during the past two to three years. The interest rate, by the end of 2024, would go to 14% to 13%. Similarly, government bonds have also seen a decline in percentage.

Nevertheless, in Pakistan, it has been predicted that its economy would grow by about 3.2% in fiscal year 2025 (FY25) that is an increase from 2.4% last year. Some foreign investors have also started sending money to Pakistan.

All these aspects would lead to the movement of money from banks to economy and in different businesses. Similarly, big companies and corporates would also take their money from banks and put in different businesses.

Money would either go to Stock Market, but this market has also crossed its all time high, or to the real estate. In the case of real estate, people from overseas have also started showing their interest. So, this can be one of the best times to purchase property.

Source:
Takhleeq - Real Estate Market Update: Latest News & Impact | Takhleeq - https://www.youtube.com/watch?v=nz2YmkYo2tc

Post 26/30: VFX tutorial for Blender – Creating a Simple Character Rig in Blender

 


On Day 26, you'll begin rigging, which is the process of setting up a skeleton (armature) for your character to enable movement. Here's a step-by-step guide to help you rig a simple character.


Step 1: Preparing the Character

  1. Open Blender and either create a simple character (e.g., a cube character) or use a pre-existing 3D model.
  2. Switch to Object Mode if you're not already in it by pressing Tab.
  3. Ensure that your model is centered and in a neutral pose, as rigging is easiest when the character is aligned with the grid.

Step 2: Adding an Armature (Skeleton)

  1. Press Shift + A to bring up the Add menu.
  2. Navigate to Armature > Single Bone. This adds a bone to the center of your scene.
  3. Switch to X-ray mode to see the bone inside your mesh. Do this by selecting the armature, then enabling Viewport Display > In Front in the properties panel.

Step 3: Editing the Armature

  1. Switch to Edit Mode by selecting your armature and pressing Tab.
  2. Use the G key to grab and move bones, or the E key to extrude new bones from the current one. Start by positioning the bone inside the torso of your character.
  3. Create new bones by extruding from the base bone to form a basic skeleton for your character. For example:
    • Extrude upwards to create the spine.
    • Extrude outwards to create limbs (arms, legs).
    • Create additional bones for areas like the head and feet.

Step 4: Assigning Bones to Mesh (Parenting)

  1. Once your armature is complete, return to Object Mode.
  2. Select your character mesh, then hold Shift and select the armature.
  3. Press Ctrl + P and choose With Automatic Weights. This assigns the bones to the mesh, allowing the mesh to move with the bones.

Step 5: Testing the Rig

  1. Switch to Pose Mode by selecting the armature and pressing Ctrl + Tab.
  2. Select individual bones and use the G (move) or R (rotate) keys to test how the mesh deforms.
  3. Make adjustments by switching back to Weight Paint Mode if necessary, to ensure that parts of the mesh are properly influenced by the correct bones.

Shareable Visual:

Create a short video or screenshot showing your rigged character in a simple pose, demonstrating that the bones are correctly influencing the mesh.

Source:
ChatGPT

Day 22: Blender tutorial for making illustrations – Designing Interactive Diagrams (Clickable or Animated Paths)


Today, you will learn how to create interactive or animated diagrams in Blender. These diagrams will guide viewers through different paths, making your educational videos more engaging and interactive. You’ll animate elements that can trigger different actions, such as moving along a flowchart path or highlighting a section of a mind map.


Step-by-Step Guide:

1. Setting Up Your Scene

  • Open Blender and set up a new project.
  • Switch to 2D Animation mode by selecting it from the splash screen or creating a new 2D workspace.
  • Clear the default objects if necessary and start with a clean workspace.

2. Creating the Diagram Base

  • Use Grease Pencil to draw a flowchart, mind map, or any other educational diagram. You can create nodes using simple shapes like circles or squares and connect them with lines or arrows.
  • Add text labels to each node using the Text tool, explaining each part of your diagram.

3. Preparing the Animation

  • Select the elements (nodes and lines) that will be animated.
  • Create an animation timeline by opening the Dope Sheet and setting keyframes for your nodes and text.
  • For interactive paths, you’ll need to animate the movement between different sections. For instance, create animations that show a progression from one node to another using keyframes.
  • Add keyframes for movement (location), scaling, or rotation, depending on how you want elements to interact.

4. Adding Triggers and Interactivity

  • Path Animation: Use Bezier curves to define movement paths between nodes or sections. Convert a curve into a path and assign objects (like arrows or markers) to follow it.
  • In the Object Data Properties panel, under Path Animation, adjust the Frames to control how long it takes for the object to move from start to finish on the path.

5. Enhancing Interactivity with Visibility

  • You can animate visibility to create the effect of items appearing or disappearing as users "interact" with the diagram. Use keyframes on the Visibility property (found under the Object Properties panel).
  • For example, you can animate text to appear sequentially as viewers progress through different nodes.

6. Refining with Camera Movements

  • Add a camera and animate its movement using keyframes. You can move the camera from one section of the diagram to another, creating a dynamic and interactive feel.
  • Go to the Timeline, select the camera, and add keyframes to adjust its position and focal length to zoom in or out on different parts of the diagram.

7. Testing and Previewing

  • Use the Timeline to scrub through your animation and check the flow. Make sure that the interactive paths are smooth, and the timing feels natural.
  • Adjust the duration and easing of transitions to enhance user engagement.

8. Rendering the Animation

  • Once satisfied with the interaction and animation, go to the Render Properties tab.
  • Set your render output to the desired video format (e.g., MP4), adjust resolution, and select Output Folder to save your video.
  • Click on Render Animation to export your interactive diagram as a video.

9. Adding Sound or Voiceover

  • Import the rendered video into a video editing software (e.g., Blender’s Video Sequence Editor or another software of your choice).
  • Record and sync your voice narration to the animation, explaining each part of the diagram as it progresses.

Outcome:

  • By the end of Day 22, you will have created an interactive or animated flowchart or mind map that guides viewers through a process with animations that move along paths. This will be ready to include in your illustrative videos with voiceover narration.

Source:
ChatGPT